Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete lines from file 1

Status
Not open for further replies.

dmjoen

Technical User
Jul 26, 2001
31
US
Hi,

I need to delete several lines from a file that fall before a certain line in the file. For example:

line 1
line 2
line 3
line 4
.
.
.
.
STARTUP

I need to delete all of the lines before the line that contains STARTUP.

Any help appreciated.

Thanks
 
Something like this ?
awk '/STARTUP/{++flg}flg' /path/to/input >output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
If you don't want the STARTUP line, you may try this:
sed '1,/STARTUP/d' /path/to/input >output

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top