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 212    some text 3  222.6   24.4   Some long other text 319    some text 4    3.4    1.5   Some long other text 421    some text 5   55.4   10.6   Some long other text 532    some text 6    2.9    9.4   Some long other text 6I'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?
Sort aligned columns
scripting;sort
Sort based on column offset:sort -k1.27gNote that the g flag above (for general numeric sorting) is not standard so may not be supported by your  sort implementation.With that particular data sample, you can get away with:LC_ALL=C sort -k1.27That is do an alphanumeric sort and use the C locale to make sure the leading spaces are not ignored in the sorting. So for instance [ ]4.4 sorts before 24.4 even though 4 sorts after 2.