sort command SUMMARY

2007-12-25 2:02:00

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.

Comments

Got something to say?

You must be logged in to post a comment.