matang
matang

Reputation: 259

linux sort command with delimiter in data

I need to sort a big csv file .So,using

sort

command will be quite good.

But, I am facing an issue that delimiter ',' is also present in the data . So, sorting on fields with ',' works unexpectedly .

The file contains data like

Ahmedabad ,"7,Olive residency ", 380058
Gandhinagar,"85,Kabir villa",38048
Surat ,Binory Bunglows,589635

And I am using sort command like

 sort --field-separator=',' -s -k 3,3  bigfile.csv 

Which does not give desired output.

Can any one help me with this ?

Upvotes: 0

Views: 12687

Answers (1)

Or Davidi
Or Davidi

Reputation: 109

sort -k3 -t',' -nr bigfile.csv 

Upvotes: 4

Related Questions