sorting - Want to sort large csv file having date in the format ddMONYYYY using unix sort command -


aman@gmail.com,"08oct2012" abc@gmail.com,"11jul2012" def@gmail.com,"16dec2010" abc@gmail.com,"16mar2011" aman@gmail.com,"21apr2011" abc@apple.com,"12dec2010" xyz@fb.com,"06mar2011" 

want sort above csv using unix sort command 1st email address , date

i have tried like

sort -k1 -k212 -k23m -k26 file.csv 

but didn't work out. has idea how sort csv?

you may need sort -t, indicate delimiter comma ,.

then, should work:

sort -t, -k1 -k2 file.csv 

anyway, sort date should firstly -> unix stamp conversion in date field.


Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -