I have quite a few text files that have text in them that I want to remove. The bottom line is consistent but there are two lines about it that are different almost every time. For example:
This is the beginning of a junk entry but a different each time
This is junk
-- END OF ENTRY --
Is it possible to find the line that says '-- END OF ENTRY --', whether using sed, awk, grep or whatever and remove it and the two previous lines?
I have found a way to replace the text on the bottom line using sed with s/ and /g but I can't search and replace the other two as they change.
Can anyone help?
Thanks
Tried sed with search and replace (s/ and /g) but this doesn't help as the two previous lines change all the time.