LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   Number sort order (https://www.linuxquestions.org/questions/programming-9/number-sort-order-4175470666/)

dmesserly 07-23-2013 04:22 PM

Number sort order
 
I want my numeric sort to turn out 1 2 10 20 instead of 1 10 2 20. How can this be done?

szboardstretcher 07-23-2013 04:40 PM

well... if this is filenames that we are talking about:

Code:

ls -1v
or numbers in a file:

Code:

sort -g filename

dmesserly 07-23-2013 05:02 PM

Thank you very much. So for Linux/Unix the "sort -g" will work on the data. Do you know a way to do this in the world of Microsoft - more specifically Access? If not that's cool, cause I can export the data and do a Linux sort on it.


All times are GMT -5. The time now is 10:04 AM.