avatar
T*B
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
avatar
X*r
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

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。