Welcome to the Monastery | |
PerlMonks |
Grab 3 lines before and 2 after each regex hitby HarryPutnam (Novice) |
on Apr 24, 2014 at 14:09 UTC ( [id://1083602]=perlquestion: print w/replies, xml ) | Need Help?? |
HarryPutnam has asked for the wisdom of the Perl Monks concerning the following question:
I'm hoping there might be a module that can be made to do what I want (grab 3 lines before and 2 after each rgx hit).
This would be in common txt files.
Seems like it would be as popular as gnu grep's -Anum -Bnum operators. If not a module... then a brief walk thru of how it might be done so that I can write it myself... It's ok if its primitive. I do have some experience... just not much I'm just thinking it must be a fairly common desire for hardened 'perlers' and maybe there is kind of common way of doing it.
Back to
Seekers of Perl Wisdom
|
|