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