AWK -- How to do selective multiple column sorting?
Posted
by
nawesita
on Stack Overflow
See other posts from Stack Overflow
or by nawesita
Published on 2012-10-01T17:45:50Z
Indexed on
2012/10/02
3:37 UTC
Read the original article
Hit count: 217
In awk, how can I do this:
Input:
1 a f 1 12 v
2 b g 2 10 w
3 c h 3 19 x
4 d i 4 15 y
5 e j 5 11 z
Desired output, by sorting numerical value at $5
:
1 a f 2 10 w
2 b g 5 11 z
3 c h 1 12 v
4 d i 4 15 y
5 e j 3 19 x
Note that the sorting should only affecting $4
, $5
, and $6
(based on value of $5
), in which the previous part of table remains intact.
© Stack Overflow or respective owner