i ahve a file like:
*************************************
sree
122132
12321
***********************************
phani
21321
3213214
******************************
dddsds
213213123
23213213
*******************************
i want to sort the file with respect to name how we can do this
thank u
sree
awk '{
if(index($0,"*")==1 && NR > 1) { printf("\n") }
printf("%s|", $0)
}
END { printf("\n") }
' filename | sort | tr -s '|' '\n' > sortedfile
filename:
*************************************
sree
122132
12321
*************************************
phani
21321
3213214
*************************************
dddsds
213213123
23213213
*************************************
zzzzzzz
9999999
8888888
output in sortedfile:
*************************************
dddsds
213213123
23213213
*************************************
phani
21321
3213214
*************************************
sree
122132
12321
*************************************
zzzzzzz
9999999
8888888