Advanced Sorting


Separators and Columns

As an illustration of how to sort by columns, lets order the Example File by State, the 4th column in the file. Fill in the Separator with the pipe character

and the Columns with a 4

The following text should appear in the Log Window

Grabbe, Shon|6540 Dumpling Dr.|Sacramento|CA|32456      
King, David|311 Wakegan Ave.|Chicago|IL|45323           
Goldstein, Jerry|523 S. School St. #605|Hanover|NH|43939
Troike, Marc|1003 Leviathon Ln.|Dayton|OH|45034         
Wright, Timothy|2342 Woodlands Way|Houston|TX|77056
tkSort has created the sort command that separates each line in the Example File into columns, based on the pipe character, and orders them by the 4th column, which is the State.


Numeric Ordering

Lets order the Example File by the US Postal Zip Code, the 5th column. Using the same separator as before, changing the 4 to a 5, and turning on the -n option, the following should appear in the Log Window

Grabbe, Shon|6540 Dumpling Dr.|Sacramento|CA|32456      
Goldstein, Jerry|523 S. School St. #605|Hanover|NH|43939
Troike, Marc|1003 Leviathon Ln.|Dayton|OH|45034         
King, David|311 Wakegan Ave.|Chicago|IL|45323           
Wright, Timothy|2342 Woodlands Way|Houston|TX|77056
Notice this time that Mr. King is now 4th in the list, instead of second.


Index