May 24, 2005 #1 pjb Programmer May 1, 2001 148 US I have a multi field record delimited by pipes (|). I have to sort by the 11th filed ascending, 32nd field descending, and the 30th field ascending.
I have a multi field record delimited by pipes (|). I have to sort by the 11th filed ascending, 32nd field descending, and the 30th field ascending.
May 24, 2005 #2 PHV MIS Nov 8, 2002 53,708 FR man sort (the -t and -k options). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886 Upvote 0 Downvote
man sort (the -t and -k options). Hope This Helps, PH. Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
May 24, 2005 Thread starter #3 pjb Programmer May 1, 2001 148 US Thanks, had to do a little testing on the -k as what I needed was nowhaere on the man page. Here is what I came up with. It seems to work sort -t'|' -k 11,11 -k 32r,32r -k 30,30 This allowed me to sort field 11 and 30 ascending, and field 32 descending Upvote 0 Downvote
Thanks, had to do a little testing on the -k as what I needed was nowhaere on the man page. Here is what I came up with. It seems to work sort -t'|' -k 11,11 -k 32r,32r -k 30,30 This allowed me to sort field 11 and 30 ascending, and field 32 descending