The stupid question is the question not asked | |
PerlMonks |
Re: how to check for a word in a file and if found remove that line, the above line and the below line from the file.by oiskuu (Hermit) |
on Jan 22, 2016 at 17:53 UTC ( [id://1153396]=note: print w/replies, xml ) | Need Help?? |
That is a variation of the grep exercise. Check this thread for further examples. (The main difference between your task and the other one is negation of printing sense. Btw, the grep -v option only negates matching sense and so grep -v -A1 -B1 can not be used for your purposes.)
In Section
Seekers of Perl Wisdom
|
|