Article 5MWST sed or awk command to filter lines from RE to next blank line.

sed or awk command to filter lines from RE to next blank line.

by
sharky
from LinuxQuestions.org on (#5MWST)
Is there a grep, sed or awk one liner that would remove lines from a regular expression to the next blank line?

Looking at a huge log file that list errors. The log file prints the type of error and then some details. The number of lines in the details can vary but there is always a blank line after.

Example:
Quote:
type1 error
details
details

type2 error
more details
other stuff
details

type2 error
Other stuff
stupid stuff

type3 error
details
Result after filter to remove type2 error and it's details:
Quote:
type1 error
details
details

type3 error
details
latest?d=yIl2AUoC8zA latest?i=lA8705icGzI:WxXgOuRX0bI:F7zBnMy latest?i=lA8705icGzI:WxXgOuRX0bI:V_sGLiP latest?d=qj6IDK7rITs latest?i=lA8705icGzI:WxXgOuRX0bI:gIN9vFwlA8705icGzI
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments