Trim first 10 lines out of a file
How would one trim/cut the first 10 lines of a file.
I had a look at cut,head,tail and trim. are their any other commands to look at or techniques? thanks. |
awk '{if (NR!=10) {print}}' cut.me.file
|
Try
Code:
sed '1,10d' infile > outfile |
Or
Code:
awk 'NR>10' infile > outfile |
Dang, I was beaten to the 'awk' script.
Were you successful with 'tail'? tail --lines=+10 myfile The docs might give the impression that one of these would work: tail -+10 myfile tail +10 myfile but unfortunately that isn't the case - you have to use '--lines=' |
Quote:
Code:
env _POSIX2_VERSION=199209 tail +11 infile Anyway, better to use the --lines option, as you suggested, or its short form: Code:
tail -n +11 infile |
Thanks guys. I ended up using
Code:
sed '1,10d' infile > outfile Cheers. |
There are so many ways to do it, it's hard to chose.
But now that I helped you, you have to craft me a sword ;) |
All times are GMT -5. The time now is 08:16 AM. |