T***B 发帖数: 137 | 1 15 AA-1 119k118
13 BB-8 119k24
13 AB-4 22as149
11 BC-4 22as90
11 BA-1 16pk187
11 AB-1 16pk246
I need to sort the above text this way:
sort according to the first 4 characters in the
3rd column( like 119k, 12as );
then sort according to the number beginning from
the 5th character in the 3rd column (that is,
sort numerically).
the output should be:
13 BB-8 119k24
15 AA-1 119k118
11 BA-1 16pk187
11 AB-1 16pk246
11 BC-4 22as90
13 AB-4 2 | X****r 发帖数: 3557 | 2 sort -n -b -k3.5 | sort -s -b -k3.1,3.4
( GNU sort 2.0.21 )
【在 T***B 的大作中提到】 : 15 AA-1 119k118 : 13 BB-8 119k24 : 13 AB-4 22as149 : 11 BC-4 22as90 : 11 BA-1 16pk187 : 11 AB-1 16pk246 : I need to sort the above text this way: : sort according to the first 4 characters in the : 3rd column( like 119k, 12as ); : then sort according to the number beginning from
|
|