Timeline for Trying to sort on two fields, second then first
Current License: CC BY-SA 3.0
6 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 2, 2015 at 19:08 | comment | added | augurar |
@manatwork That should not be necessary; if all the specified fields compare equal, sort will compare the entire line. Or with GNU sort you can use -s for stable sort.
|
|
| Oct 26, 2012 at 8:01 | comment | added | manatwork |
@TonyBedford, correct. But not specifying the stop position will not change the result for your current input, but will force consistency in case you will ever have multiple lines with identical field 2 and 1. So I prefer to allow the last -k to include as much as it can.
|
|
| Oct 26, 2012 at 7:45 | comment | added | Harry | This got me thinking along the right lines - thanks for that. But don't you need to specify the stop point for the second -k. That is -k2,2 -k1,1 otherwise the stop point is taken as end of line? | |
| Oct 24, 2012 at 12:26 | history | edited | manatwork | CC BY-SA 3.0 |
added 378 characters in body
|
| Oct 24, 2012 at 12:19 | comment | added | scai | Could you please explain this strange notation? | |
| Oct 24, 2012 at 12:15 | history | answered | manatwork | CC BY-SA 3.0 |