Page 1 of 1

Ability to sort on more than three keys

Posted: Thu May 23, 2013 12:47 am
by pseakins
I maintain a log file which had become corrupted, containing duplicated entries and entries that were out of sequence. The log is keyed with a time stamp but unfortunately it is in the American mm/dd/yyyy hh:mm:ss:msec format which is not naturally sortable. In order to sort it, it is necessary to sort on FOUR keys - yyyy, mm, dd and time.

So, I would like to see four or more sort keys available in the "Sort Selected Lines" option.

My solution was to temporarily cut and paste the yyyy column, moving it to column one and then perform a natural sort. A fourth sort key would have been simpler.

(Sample log entry)
03/25/2013 20:32:54:652 End copy/ftp session

Posted: Thu May 23, 2013 1:06 pm
by Art Metzer
In this particular case, couldn't you haven gotten away with sorting on just three keys?

Key 1: YYYY (From 7 Length 4)
Key 2: MM/DD (From 1 Length 5)
Key 3: Time (From 12 Length 12)

Posted: Thu May 23, 2013 3:26 pm
by pseakins
Yes, of course I could have. Couldn't see the woods for the trees! In this case I was thinking Non-American where the day precedes the month and four fields would be needed. Thanks.