由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - an AWK question?
相关主题
新手问个基础问题how to count the total number of lines
how to get part of a big text file?my script Re: how would you do this?
reverse the lines?使用 AWK 中的问题
how to contral tar-ed file size?怎样让AWK认多个分隔符?
HOw to find files hardlinked to a same inode?AWK problem, SOS!
[转载] where is the 'iostream' file ?Re: an AWK question? (thanks seis)
问:direct files to trash but list file namesshell script里如何取得多个return value?
面试中的unix, linux的几个问题,不知道自己答对了没有。求Sed-and-Awk-101-Hacks电子版
相关话题的讨论汇总
话题: awk话题: file话题: question话题: lines话题: hi
进入Unix版参与讨论
1 (共1页)
d*****y
发帖数: 12
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
s**s
发帖数: 242
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
:

s**s
发帖数: 242
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
:

a*******s
发帖数: 324
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
:

1 (共1页)
进入Unix版参与讨论
相关主题
求Sed-and-Awk-101-Hacks电子版HOw to find files hardlinked to a same inode?
awk question[转载] where is the 'iostream' file ?
group permission问:direct files to trash but list file names
怎样用mail把某一文本文件发送给一个email地址?面试中的unix, linux的几个问题,不知道自己答对了没有。
新手问个基础问题how to count the total number of lines
how to get part of a big text file?my script Re: how would you do this?
reverse the lines?使用 AWK 中的问题
how to contral tar-ed file size?怎样让AWK认多个分隔符?
相关话题的讨论汇总
话题: awk话题: file话题: question话题: lines话题: hi