Skip to main content

Timeline for Sorting numerically

Current License: CC BY-SA 4.0

18 events
when toggle format what by license comment
Apr 15, 2019 at 21:33 comment added user347221 For those looking to an answer to my question in the comment above. Here it is: unix.stackexchange.com/questions/78925/…
Apr 15, 2019 at 19:34 history edited Stéphane Chazelas CC BY-SA 4.0
added 2 characters in body
Apr 15, 2019 at 17:58 history edited Stéphane Chazelas CC BY-SA 4.0
added 243 characters in body
Apr 15, 2019 at 17:23 vote accept user347221
Apr 15, 2019 at 17:23 comment added user347221 What is the syntax to get it to sort on the second and third columns, then on the fifth and stop here?
Apr 15, 2019 at 17:22 comment added user347221 @StéphaneChazelas Thank you, this is great. unix.SE is eons beyond other SE sites. People actually help here. I've had great experiences with many of the users here. Gilles, Kusalananda, Stephen, terdon to name a few. Thank you all.
Apr 15, 2019 at 17:10 comment added Stéphane Chazelas @Barmar, they have -t, but sort on the full line (-k1 which is superflous as that's the default) instead of the first field (-k1,1). 6,1.443385383041667 is interpreted by sort -n as 61.4433853830416671 because that , thousand separator is ignored.
Apr 15, 2019 at 17:09 history edited Stéphane Chazelas CC BY-SA 4.0
added 176 characters in body
Apr 15, 2019 at 17:00 comment added Barmar Is the actual problem just that they put -t"," after the key specification instead of before it?
Apr 15, 2019 at 16:59 history edited Stéphane Chazelas CC BY-SA 4.0
added 188 characters in body
Apr 15, 2019 at 16:59 comment added Barmar Where is 61.4433853830416671 in the input file? I see 6,1.443385383041667,1.6974039491263593.
Apr 15, 2019 at 16:57 comment added Barmar Why do you talk so much about the thousands separator? There's nothing in the question that suggests that they expected it to be part of the number. They have -t"," to use it as the field delimiter.
Apr 15, 2019 at 16:47 history edited Stéphane Chazelas CC BY-SA 4.0
added 440 characters in body
Apr 15, 2019 at 16:34 comment added Stéphane Chazelas @user347221, see if the edit makes it any clearer.
Apr 15, 2019 at 16:34 history edited Stéphane Chazelas CC BY-SA 4.0
added 712 characters in body
Apr 15, 2019 at 16:18 comment added user347221 Thanks. sort -t, -n -k1,1 is not working for me, it's placing 0 above id. Also, does your answer explain why 10 is larger than 9, but smaller than 6, all the while 11 being greater than them all? It's genuine question, I'm not able to answer this myself from reading your answer.
Apr 15, 2019 at 15:50 history edited Stéphane Chazelas CC BY-SA 4.0
added 7 characters in body
Apr 15, 2019 at 14:47 history answered Stéphane Chazelas CC BY-SA 4.0