Quote:
Originally Posted by josesec
I have used the same matrix that you haved used in the last message and the result is that one:
41.0 5.0 8
41.0 10.0 7
41.0 15.0 12
41.0 20.0 10
40.00 -20.00 1.39
40.00 -19.00 2.05
40.00 -19.10 2.16
40.00 -19.20 2.25
40.00 -9.90 29.64
40.00 9.90 28.25
39.00 0.00 26.78
39.00 -0.10 28.00
39.00 0.10 28.13
39.00 -0.20 26.72
39.00 0.20 30.18
39.00 -0.30 26.98
39.00 0.30 33.31
39.00 -0.40 25.58
I have used sort -k1rn -k2n infile but I find still the problem with decimals (not well organized at all), I feel this must be a silly problem but I don't manage to fix it.
Thank you
|
The problem is simply that the minus sign is ignored and the fields are sorted numerically in respect of their absolute value. The solution may reside in your current locale settings. Please check them using the command:
and post the output here. To be sure the file is sorted as desired, force the LC_COLLATE variable to be C or POSIX:
Code:
env LC_COLLATE=C sort -k1rn -k2n file