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:
> [c...@gcs-linux02 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
> [c...@gcs-linux02 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
      ____
   __
__
       ____
    __
 __
___________


Reply via email to