[NTLUG:Discuss] Linux sort

Leroy Tennison leroy_tennison at prodigy.net
Mon Apr 21 00:24:52 CDT 2008


How do you sort a tab-delimited file using sort?  Created the following 
test file (named test):

five    zzzzz   5
Four    vcxvbc  3
one     asdf    4
three   ghjks   1
Two     qwerty  2

(those are tabs separating the text, I checked with hexdump)


I've tried

sort -t\t -k3,3 test
sort -t\t -k3n,3 test
sort -t '9' -k3,3 test
sort -t '\9' -k3,3 test	(Produces a "multi-byte tab" error message)



More information about the Discuss mailing list