bug-coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SORT bug: multiple field sort


From: Denzen, van Carl
Subject: SORT bug: multiple field sort
Date: Wed, 24 Mar 2010 14:44:29 +0100

On a quite fresh ubuntu with sort version  6.10, when I do a quite simple sort, 
I get unexpected result.
Fields are variable length, separator is comma. I want to sort on two date 
fields, but for simplicity I treat them as normal ascii. Here is the output:
address@hidden carl]$ cat test-input.txt
23-01-1999,25-04-2008
,24-04-2008
23-01-1993,23-04-2008
,01-02-1999
,12-03-1998
23-01-1991,21-04-2008
address@hidden carl]$ sort <test-input.txt --field-separator=, --key=1.7,1.10 
--key=1.4,1.5 --key=1.1,1.2 --key=2.7,2.10 --key=2.4,2.5 --key=2.1,2.2
,01-02-1999
,12-03-1998
23-01-1991,21-04-2008
23-01-1993,23-04-2008
23-01-1999,25-04-2008
,24-04-2008

I expected the record with date 12-03-1998 to sort before the record with date 
12-03-1998.
What am I doing wrong? Or is sort doing something wrong (like walking out of 
field #1 and sorting on parts of field #2)?
I did read the FAQ about locale issues and I did set LC_ALL to C (export 
LC_ALL="C"). Same unexpected result.

Carl.

Carl van Denzen
Applicatie consultant
Healthcare Sector

PinkRoccade Healthcare b.v.
Wolga 5
2491 BK  Den Haag
The Netherlands

M: +31 (0)6 2952 8914 (ma/di/wo/do)
E: address@hidden<mailto:address@hidden>

PinkRoccade Healthcare b.v. Handelsregister 27322973 te Den Haag



The information transmitted is intended only for use by the addressee and may 
contain confidential and/or privileged material. Any review, re-transmission, 
dissemination or other use of it, or the taking of any action in reliance upon 
this information by persons and/or entities other than the intended recipient 
is prohibited. If you received this in error, please inform the sender and/or 
addressee immediately and delete the material. Thank you.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]