I have a fixed-width-field file which I\'m trying to sort using the UNIX (Cygwin, in my case) sort utility.
The problem is there is a two-line header at the top of t
It only takes 2 lines of code...
head -1 test.txt > a.tmp; tail -n+2 test.txt | sort -n >> a.tmp;
For a numeric data, -n is required. For alpha sort, the -n is not required.
Example file: $ cat test.txt
header 8 5 100 1 -1
Result: $ cat a.tmp
header -1 1 5 8 100