[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SORT bug: multiple field sort gives unexpected sort order
From: |
Pádraig Brady |
Subject: |
Re: SORT bug: multiple field sort gives unexpected sort order |
Date: |
Tue, 16 Mar 2010 11:50:01 +0000 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.8) Gecko/20100227 Thunderbird/3.0.3 |
On 15/03/10 15:56, Denzen, van Carl wrote:
> On ubuntu v9.03 with sort version 6.10, when I do a quite simple sort, I get
> unexpected result.
> Fields are variable length, separator is a comma. I want to sort on two
> (Dutch style, dd-mm-yyyy) date fields. 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
Here is the output from running with the soon to be released --debug option.
That shows that the first field is considered to be the delimiter+second field
in the case where the first field is empty. That is at least confusing and
may be a bug. I'll look at it this evening sometime.
cheers,
Pádraig.
$ ./src/sort --debug <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
____
__
__
____
__
__
___________