What exactly are you having trouble with? Just read the file line by line, and when you find the regex, set a counter to N, and then for each line thereafter, print the line if the variable is greater than zero. Then decrement the variable and continue the loop.
...roboticus
When your only tool is a hammer, all problems look like your thumb.
In reply to Re: Print next N lines after a pattern is matched.
by roboticus
in thread Print next N lines after a pattern is matched.
by manutd
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |