GNU sort

I already wrote that GNU Core Utilities (GNU Textutils) have become my favorite text processing tools. Today i wanted to sort a couple of lines using the last three numbers of each line. Here is an example:

c:/data/backup/JA-229
c:/data/backup/JA-221
c:/data/backup/JA-233
c:/data/backup/NE-046
c:/data/backup/NE-049
c:/data/backup/JA-217
c:/data/backup/JA-225

With the command “sort -n -t- -k2 myfile.txt” i quickly got what i needed.

This entry was posted on Monday, February 6th, 2006 at 02:55 and is filed under Free Software. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.