0

I have a file F.tsv with 13 columns, the last column (the 13th columns) looks like this:

2.1e-06
0.58
10
8.7e-22
0.0014
0.034
9.5
0.67
0.67
0.68
9.2
8.4e-22
9.7

I've tried sort -k 13 F.tsv but it didn't work since this didn't consider the scientific notation (like 2.1e-06).

Is there any way to sort considering the scientific notation like this:

8.4e-22
8.7e-22
1.3e-08
1.3e-08
7e-07
2.1e-06
0.0014
0.034
0.58
0.67
0.67
0.68
9.2
9.5
9.7
10
1
  • If you're using Linux you should have the GNU implementation of sort, which provides a -g or --general-numeric sort option Nov 14, 2019 at 17:40

1 Answer 1

1

I get the desirewd result with:

LC_ALL=C sort -g -k 13 F.tsv
3

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .