简体   繁体   中英

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 ?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM