Apr 13, 2005 #1 amarg Programmer Nov 19, 2002 106 IN Hi, I have some data in CSV Fromat. I want to sort the file based on first field on the command prompt. Thanks, Amar
Hi, I have some data in CSV Fromat. I want to sort the file based on first field on the command prompt. Thanks, Amar
Apr 14, 2005 #3 SamBones Programmer Aug 8, 2002 3,186 US Actually, if the first field varies in length, that might not work. It should be... Code: sort -t ',' -k 1 file.csv > file.sorted.csv The "[tt]-t[/tt]" defines the field separator, and the "[tt]-k[/tt]" defines which field to sort on. Hope this helps. Upvote 0 Downvote
Actually, if the first field varies in length, that might not work. It should be... Code: sort -t ',' -k 1 file.csv > file.sorted.csv The "[tt]-t[/tt]" defines the field separator, and the "[tt]-k[/tt]" defines which field to sort on. Hope this helps.
Apr 15, 2005 Thread starter #4 amarg Programmer Nov 19, 2002 106 IN That's what I am looking for. Thanks. Upvote 0 Downvote