I have a program which output looks like this
# Status VAL1 VAL2 Description
1 some text 2.5 4.4 Some long other text
5 some text 2 14.5 2.0 Some long other text 2
12 some text 3 222.6 24.4 Some long other text 3
19 some text 4 3.4 1.5 Some long other text 4
21 some text 5 55.4 10.6 Some long other text 5
32 some text 6 2.9 9.4 Some long other text 6
I'd like to sort along the VAL2 column. I tried with sort -k 4 but when there's spaces in the Status column sort get confused.
Is there a way to work around this? Maybe to pass a character number instead of a field number?
-koption tosort(1). Just make sure the input file doesn't contain tabs, as they will throw off your count (expand(1))