Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help on command line

Status
Not open for further replies.

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
 
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.
 
That's what I am looking for. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top