Hi All, Greetings to all of you.

December 28, 2010 at 04:48:43
Specs: AIX Unix
I am looking for the solution to sort the fields in the below file data to get the output as described below.

Input file data: (Fixed lenggth of 850 layout)
35201012240061550000003300010335000110240 3300010335000119240 NOT FOUND E201008135399KUMARAN sho BRA -00000023200 BRA 4Z MCCN00000000000 18030
35201012240061550000003300010335000111150 3300010335000115150 NOT FOUND E201008135399KUMAR IL BRA -00000023200 BRA 4Z MCCN00000000000 18030
35201012240061550000003300010335000133360 3300010335000130360 NOT FOUND E201008135399KUMARAN BRA -00000023200 BRA 4Z MCCN00000000000 18030
35201012240061550000005310200000000028000 5310200000000026000 NOT FOUND E201008135399RankjuN sho BRA -00000023200 BRA 4Z MCCN00000000000 18030

Need to sort the postion for 53-82 and 23-52 using AWK command in UNIX KSH script.

Output file data:

The above input file needs to be sorted based on the position first 53-82 and following 23-52 .

Any help is very much appreciated.

Saji G.

See More: Hi All, Greetings to all of you.

Report •

December 28, 2010 at 09:34:00
Why are you asking for an awk solution? I think the unix sort command is the proper tool. This link solves a similar problem:


Report •

December 29, 2010 at 08:06:36

This is fine with SORT but my requirement is to do it using AWK command of sorting the same.

Any reply would be highly appreciated.

Saji G.

Report •

December 29, 2010 at 09:30:21
Sorry, but I don't much feel like doing your home work. I think it would involve reading your data into an awk array.

I did post a link about using qsort in awk that you might find useful:


Report •

Related Solutions

Ask Question