I have a CSV file like this:
bear,1
fish,20
tiger,4
I need to sort it from greatest to least number, based on what is found in the second column, e.g.:
fish,20
tiger,4
bear,1
How can the file be sorted in this way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
will do what you want.
-t,specifies the field separator to be a comma-k+2specifies the field to sort on (field2)-rspecifies a reverse sort-nspecifies a numeric sort