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 :
|
|