M
Madhusudhanan Chandrasekaran
Hi,
I am a perl newbie. I am reading from a file line by line and
matching it for a partiuclar regex. If the match is found, I want
to print the previous and the next few lines.
i.e. if the lines of the file are:
This is a
String
But I do not
know how to
print it
and if my pattern is "But I do not", I would like to print as
"String But I do not know how to". Here it prints out the previous
and the next line, keeping it variable is desired.
Thanks in advance,
_Madhu
I am a perl newbie. I am reading from a file line by line and
matching it for a partiuclar regex. If the match is found, I want
to print the previous and the next few lines.
i.e. if the lines of the file are:
This is a
String
But I do not
know how to
print it
and if my pattern is "But I do not", I would like to print as
"String But I do not know how to". Here it prints out the previous
and the next line, keeping it variable is desired.
Thanks in advance,
_Madhu