GNU bug report logs - #24527
Problem while sorting comma separated values using sort command.

Previous Next

Package: coreutils;

Reported by: Jash Dave <jashdave23 <at> gmail.com>

Date: Sat, 24 Sep 2016 13:13:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jash Dave <jashdave23 <at> gmail.com>
To: bug-coreutils <at> gnu.org
Subject: Problem while sorting comma separated values using sort command.
Date: Sat, 24 Sep 2016 15:14:28 +0530
[Message part 1 (text/plain, inline)]
There is problem while sorting comma separated entries (specifically
numbers). Even when the separator symbol is set to comma, it reads all
following columns with numbers, and doesn't treats comma as separator
between following numbers.

If I use command:
sort -t"," -k1 -n Example.csv

Example.csv :
1,100,a,1,a
4,1000,d,4,c
3,1002,c,3,c
22,10,a,2,b

Output:
1,100,a,1,a
22,10,a,2,b
3,1002,c,3,c
4,1000,d,4,c


Expected:
1,100,a,1,a
3,1002,c,3,c
4,1000,d,4,c
22,10,a,2,b

But it works with column 2 or 4, since there are no following numbers.

Regards,
Jash Dave.
[Message part 2 (text/html, inline)]

This bug report was last modified 6 years and 266 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.