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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete matched line and previous line

Status
Not open for further replies.

spookie

Programmer
May 30, 2001
655
IN
Hi,

How do i delete a pattern matched line and line previous to that line?

Thanks in advance

--------------------------------------------------------------------------
I never set a goal because u never know whats going to happen tommorow.
 
What have you tried so far and where in your code are you stuck ?

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
You can achieve this in awk by saving each line in a variable and only printing it when you process the next line, discarding the contents if the current line matches your search string.

Annihilannic.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top