GNU bug report logs -
#23673
wrong sorting order
Previous Next
Reported by: alainm <alain.miniussi <at> oca.eu>
Date: Wed, 1 Jun 2016 15:33:01 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
Hi
I need to perform a sort based on the first 3 indexes of a line (sort
-k 1,3 -n truc.lst):
The 0 coordinates are not placed before the 2 coordinates, it looks like
the spaces are ignore:
[alainm <at> tagir 1src]$ more truc.lst
2 9 32 27 1.3925940E-13
0 29 33 33 0.0000000E+00
0 29 33 1 0.0000000E+00
0 29 33 1 0.0000000E+00
0 29 33 1 0.0000000E+00
2 9 32 19 0.0000000E+00
2 9 32 19 0.0000000E+00
2 9 32 27 0.0000000E+00
0 29 33 9 0.0000000E+00
0 29 33 9 0.0000000E+00
0 29 33 9 0.0000000E+00
2 9 32 35 1.4211723E-13
2 9 32 19 1.3592767E-13
0 29 33 1 1.5564060E-13
2 9 32 43 1.4770083E-13
0 29 33 17 0.0000000E+00
0 29 33 17 0.0000000E+00
2 9 32 11 8.4966119E-14
0 29 33 25 0.0000000E+00
2 9 32 3 0.0000000E+00
2 9 32 3 0.0000000E+00
2 9 32 3 0.0000000E+00
2 9 32 3 4.8971061E-14
0 29 33 41 0.0000000E+00
2 9 32 11 0.0000000E+00
2 9 32 11 0.0000000E+00
2 9 32 11 0.0000000E+00
[alainm <at> tagir 1src]$ sort -k 1,3 -n truc.lst
2 9 32 11 0.0000000E+00
2 9 32 11 0.0000000E+00
2 9 32 11 0.0000000E+00
2 9 32 11 8.4966119E-14
2 9 32 19 0.0000000E+00
2 9 32 19 0.0000000E+00
2 9 32 19 1.3592767E-13
2 9 32 27 0.0000000E+00
2 9 32 27 1.3925940E-13
2 9 32 3 0.0000000E+00
2 9 32 3 0.0000000E+00
2 9 32 3 0.0000000E+00
2 9 32 3 4.8971061E-14
2 9 32 35 1.4211723E-13
2 9 32 43 1.4770083E-13
0 29 33 1 0.0000000E+00
0 29 33 1 0.0000000E+00
0 29 33 1 0.0000000E+00
0 29 33 1 1.5564060E-13
0 29 33 17 0.0000000E+00
0 29 33 17 0.0000000E+00
0 29 33 25 0.0000000E+00
0 29 33 33 0.0000000E+00
0 29 33 41 0.0000000E+00
0 29 33 9 0.0000000E+00
0 29 33 9 0.0000000E+00
0 29 33 9 0.0000000E+00
[alainm <at> tagir 1src]$
[alainm <at> tagir 1src]$ sort --version
sort (GNU coreutils) 8.4
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by Mike Haertel and Paul Eggert.
Cheer
Alain
This bug report was last modified 6 years and 213 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.