logo       

sort command SUMMARY: msg#00090

os.solaris.managers.summaries

Subject: sort command SUMMARY

Thanks to everyone that replied. John Leadeham sent me the simplest solution.
Which was:
sort -k10.7n,10.10n -k10.1,10.2n -k10.4,10.5n filename

My problem was that I'm using an old sort command which for some reason
doesn't work when using the -k option. Even though it is stated in the man
pages.

Thanks again



Original posting:
I'm having trouble getting a text file to sort properly. I have a text file
with a date (ie. 02/14/2002) in the 10th field. I want to sort the file from
earliest to latest but I'm having a problem getting the correct sort command
that will first sort it by year and then by month, day.

Sorry for such an elementary question. I've checked out the man pages, but
nothing seems to work.


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise