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:
Result after filter to remove type2 error and it's details:
Quote:
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 |
Quote:
type1 error details details type3 error details |