The Linux command “sort” is both powerful and confusing. The manpage tells us that the “-t” switch can be used to set the field delimiter.
If you’ve tried various combinations of “-t” and “\t” to tell sort that your file is tab-delimited without success, try this (bash shell):
TAB=`echo -e "\t"` sort -t"$TAB" myfile
with “-kN” as appropriate, where N is the column on which to sort.
Long-winded discussion with much incorrect syntax in this forum; or get straight to the point in this mail archive.
Neil,
when your typing on your keyboard, press Ctrl-V then press the tab key: you’ll get the tab character without calling the linux completion process.
Pierre
Or indeed, do it Pierre’s way. Nice tip.
This also works:
sort -t$’\t’ myfile