avatar
d*y
1
Hi,

I have a text file, and I want to delete the top 5 lines of
the file. I don't want to use "wc" to count
the total lines of the file (coz it is big). So I think maybe AWK
may helps?
Please give your hand ......
Thanks
avatar
s*s
2
sed can do it:
cat file | sed -e '1,5d' >file.out

【在 d*****y 的大作中提到】
: Hi,
:
: I have a text file, and I want to delete the top 5 lines of
: the file. I don't want to use "wc" to count
: the total lines of the file (coz it is big). So I think maybe AWK
: may helps?
: Please give your hand ......
: Thanks
:

avatar
s*s
3
awk:
awk '{if(NR > 5) print $0}' file>file.out

【在 d*****y 的大作中提到】
: Hi,
:
: I have a text file, and I want to delete the top 5 lines of
: the file. I don't want to use "wc" to count
: the total lines of the file (coz it is big). So I think maybe AWK
: may helps?
: Please give your hand ......
: Thanks
:

avatar
a*s
4
hi,
you can use tail.
tail +6 filename >newfile

【在 d*****y 的大作中提到】
: Hi,
:
: I have a text file, and I want to delete the top 5 lines of
: the file. I don't want to use "wc" to count
: the total lines of the file (coz it is big). So I think maybe AWK
: may helps?
: Please give your hand ......
: Thanks
:

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