The input file is as below
AR,age,marks,roll,section,evin,25,80,456,A,atch,23,56,789,B,eena,24
,78H245,C,Ps,ot,ecessary,hat,ame comes first then age and rest AR
AZ,kevin,25,80,456,A,Satch,23,56,789,Satch,23,56,789,B,Meena,24,78,H245,C,AZ
................
................
I am writting the below code .
I have to serch the lines containing strings in between the top name.
The top names are AR,AZ...
echo "Give the top name"
read top
/usr/bin/sed -n '/$top/,/$top/p' inputfile | /usr/bin/sed '/,/\\n/g' > exclude_file
example If the top name is AR,output will be
age
marks
roll
section
evin
25
80
456
A
atch
23
56
789
B
eena
24
78H245
C
Ps
ot
ecessary
hat
ame comes first then age and rest