Redian新闻
>
how to set cutoff for sorting within unix system
avatar
how to set cutoff for sorting within unix system# Computation - 科学计算
f*g
1
Hi All,
Does anyone know how to set cutoff for the sort command in the Unix system?
such as
1 desk 200
2 book 300
3 chair 100
How can I filter out the Number < 200 items, and keep the rows with larger
number (200 and 300)?
Many thanks in advance.
F
avatar
I*l
2
没看懂
直接sort,然后自己cut off前半部分不就行了

?

【在 f**g 的大作中提到】
: Hi All,
: Does anyone know how to set cutoff for the sort command in the Unix system?
: such as
: 1 desk 200
: 2 book 300
: 3 chair 100
: How can I filter out the Number < 200 items, and keep the rows with larger
: number (200 and 300)?
: Many thanks in advance.
: F

avatar
c*a
3
use awk

?

【在 f**g 的大作中提到】
: Hi All,
: Does anyone know how to set cutoff for the sort command in the Unix system?
: such as
: 1 desk 200
: 2 book 300
: 3 chair 100
: How can I filter out the Number < 200 items, and keep the rows with larger
: number (200 and 300)?
: Many thanks in advance.
: F

avatar
c*a
4
suppose your file name is feng.txt
use the following command
awk '{if ($3 >=200) print $0}' feng.txt|sort -k 3b

?

【在 f**g 的大作中提到】
: Hi All,
: Does anyone know how to set cutoff for the sort command in the Unix system?
: such as
: 1 desk 200
: 2 book 300
: 3 chair 100
: How can I filter out the Number < 200 items, and keep the rows with larger
: number (200 and 300)?
: Many thanks in advance.
: F

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