gawk -F\t works, but when it comes to
sort, it fails. Under Linux or Cygwin,
$'\t' will do it. However, to input a special key Tab, no way. Can anybody figure out a way?
migrated from stackoverflow.com Aug 27 '12 at 16:11
This question came from our site for professional and enthusiast programmers.
In PowerShell, the escape character is
`. A string containing a tab can be written as
Thanks to fellows from Yahoo, Baidu and Stack Overflow, this tough problem is finally solved.
sort -t":" -k1 /var/log/accessfile
This statement give me a hint.
Now the answer is a combination of all tips.
sort -t" " -k16 foobar.txt
(the tab character is in double quotes)
foobar.txt is a text file with the tab separation.
The key is the double quotes (