delete first and last lines from a file using sed
I tried do do it using awk, but i did not find an easy way to determine the last line in file. So sed did the trick:
cat myFile | sed '1 {d}; $ {d}' > myNewFile
I tried do do it using awk, but i did not find an easy way to determine the last line in file. So sed did the trick:
cat myFile | sed '1 {d}; $ {d}' > myNewFile
The URI to TrackBack this entry is: http://linux4all.blogsome.com/2007/09/12/delete-first-and-last-lines-from-a-file-using-sed/trackback/
No comments yet.
RSS feed for comments on this post.
Line and paragraph breaks automatic, e-mail address never displayed, HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>
Get free blog up and running in minutes with Blogsome
Theme designed by Gary Rogers