Jul 12, 2002 #1 bgarlock MIS Joined Jan 23, 2002 Messages 173 Location US What is the easiest way to remove the first, and last lines of a file, regardless of size? Bruce Garlock bruceg@tiac.net http://bruceg.dyndns.org
What is the easiest way to remove the first, and last lines of a file, regardless of size? Bruce Garlock bruceg@tiac.net http://bruceg.dyndns.org
Jul 12, 2002 1 #2 olded Programmer Joined Oct 27, 1998 Messages 1,065 Location US Bruce: I'm just learning sed myself, but it seems like a good tool for what you want: delete first line: sed '1d' file delete last line: sed '$d' file Regards, Ed Upvote 0 Downvote
Bruce: I'm just learning sed myself, but it seems like a good tool for what you want: delete first line: sed '1d' file delete last line: sed '$d' file Regards, Ed
Jul 12, 2002 Thread starter #3 bgarlock MIS Joined Jan 23, 2002 Messages 173 Location US Thanks, Ed. Works great. Bruce Garlock bruceg@tiac.net http://bruceg.dyndns.org Upvote 0 Downvote
Jul 12, 2002 Thread starter #4 bgarlock MIS Joined Jan 23, 2002 Messages 173 Location US And in one line: sed -e '$d' -e '1d' file Bruce Garlock bruceg@tiac.net http://bruceg.dyndns.org Upvote 0 Downvote