Friday, January 22, 2010

Unix Sort on multiple columns

To sort, first make sure you're using the correct locale

setenv LC_ALL C

or

export LC_ALL=C

sort -k1,1 -k3,3nr new_test.txt

or (sort -k1,1 -k3nr,3 new_test.txt) not sure which

To sort on first column, and then numerically in reverse order on the third.

No comments: