bug-coreutils
[Top][All Lists]
Advanced

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

bug#24906: gnu sort, what am I doing wrong?


From: Arnold Robbins
Subject: bug#24906: gnu sort, what am I doing wrong?
Date: Wed, 09 Nov 2016 06:23:06 +0200
User-agent: Heirloom mailx 12.5 6/20/10

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





reply via email to

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