I need delete a matching line and one previous to it. e.g In file below I need to remove lines 1 & 2.
I tried "grep -v -B 1 "page.of." 1.txt and I expected it to not print the matchning lines and the context.
I tried the How do I delete a matching line, the line above and the one below it, using sed? but could not understand the sed usage.
---1.txt--
**document 1** -> 1
**page 1 of 2** -> 2
testoing
testing
super crap blah
**document 1**
**page 2 of 2**