bash sort problem
I have a input.txt file contains format like this:
35 245 0.885000 0.785000 4.730193 60.00 35 245 0.885000 0.780000 4.760514 60.00 35 245 0.885000 0.775000 4.791227 60.00 35 245 0.885000 0.770000 4.206335 58.18 35 245 0.885000 0.765000 4.233828 58.18 35 245 0.885000 0.760000 4.261681 58.18 35 245 0.885000 0.755000 4.289903 58.18 35 245 0.885000 0.750000 4.318504 58.18 35 245 0.885000 0.745000 4.347486 58.18 35 245 0.885000 0.740000 4.376862 58.18 35 245 0.885000 0.735000 4.183954 58.18 35 245 0.885000 0.730000 4.212610 58.18 35 245 0.885000 0.725000 4.241663 58.18 ... ... ... Now I want to sort the text file by the 5th column, I use the command sort -k5 input.txt>temp but it doesn't work, I mean the 5th column is not sorted. Anyone knows why? Thanks a lot! |
It works here.....
Try it without the redirection---sort -k5 input.txt |
I have to redirect the result into another file.
Because the input file is too large to read within scroll bar. Quote:
|
works for me too.
what uname -a? maybe try -k5,6 also, for numeric sorts you should use n sort -k5n or you might get tripped up later if different field widths. |
Yeah, i think it is because numerical numbers.
Thank you very much. Quote:
|
All times are GMT -5. The time now is 03:32 PM. |