0

I have a file with roughly 1000 lines of data that I want to numerically sort depending on the value of the first column. I use

sort -k1 -n file.txt

However, certain numbers, such as 2e-2 and 1.5e-5..., all end up at the end of the file. This sort command, I mean, does not comprehend the meaning of "e" in the values. How can I make it correct?

Ayn
  • 23
  • 4
  • 1
    `-n` is "integer" numeric. I cannot test ATM, but I see `sort` has a `-g` option for "general" numeric search: perhaps this will help? – DevSolar Jun 19 '22 at 12:26
  • 1
    Thanks for the response, I tried -g option, and it is working – Ayn Jun 19 '22 at 12:43

0 Answers0