GNU bug report logs -
#24906
gnu sort, what am I doing wrong?
Previous Next
Reported by: Arnold Robbins <arnold <at> skeeve.com>
Date: Wed, 9 Nov 2016 04:24:01 UTC
Severity: normal
Tags: notabug
Done: Assaf Gordon <assafgordon <at> gmail.com>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi.
I'm trying to sort by the fifth field and then numerically in reverse
order by the sixth field.
$ sort --version
sort (GNU coreutils) 8.25
Here's my data:
$ cat checkbook.txt
# Year : Month : Day : Recipient : D / W : Amount
2015:11:9:Joe's Coffee:W:5.00
2015:11:12:Mary's Doughnuts:W:5.00
2015:12:10:Joe's Coffee:W:10.00
2015:12:15:Mary's Doughnuts:W:10.00
2016:1:2:Hank's Party Store:W:35.00
2016:1:31:O'Reilly Media:D:100.00
And here's what I'm doing:
$ grep -v ^# checkbook.txt | sort -t: -k5 -k6rg
2016:1:31:O'Reilly Media:D:100.00
2015:12:10:Joe's Coffee:W:10.00
2015:12:15:Mary's Doughnuts:W:10.00
2016:1:2:Hank's Party Store:W:35.00
2015:11:12:Mary's Doughnuts:W:5.00
2015:11:9:Joe's Coffee:W:5.00
Why aren't these sorted by amounts in descending order?
What am I missing?
Thanks,
Arnold
This bug report was last modified 6 years and 238 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.