Hello Monks,
I'm trying to remove a block of lines before & after my regex match, and orignally tried it using grep like:
grep -v -B 5 -A 3 somestring ./somefile.txt
But unable to get the -B (num lines before) and -A (num lines after) to work with with-v (invert) at the same time.
So, I'm thinking perl will do the job.
Anybody have any ideas how I can do this with perl using the command line arg as the string to match on then removing 5 lines before and 3 lines after the matched string; also removing the line of the string searched.
Thanks,
Jim