Sign up ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How to sort a comma separated file (with following details) based on salary (ascending or descending)

share|improve this question

2 Answers 2

In my country the separator is not , but ; - so the solution is more complicated. Just in case this applies here too...:

export LC_ALL

and instead of -t, I use

share|improve this answer

sort -t, -k4,4 filename

That's for ascending, throw in -r for descending.

share|improve this answer
Probably going to want -n to make the sort numeric, and hopefully you salary numbers don't have commas in them :-) If so, you should paste a few example lines (with names/numbers changed a little to protect the innocent. – Kyle Brandt Dec 9 '09 at 12:51

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.