On Mar 18, 2004, at 8:20 AM, Ashish Srivastava wrote:

Hi,
I want to match a multiline pattern in a very big text
file say 500 MB. I can't take all the lines in a
string a array in one shot due to memory problem, I
have to read file in chunks of line.
Any help?

I would think you have to get it down to the lowest common denominator.


How many lines can this pattern you're looking for span? Just two or three? If so, read line-by-line, but keep the last couple available in some variable.

Maybe the pattern always starts on a certain kind of line. If that true, you could look for those, then read ahead enough to see if it's there or not.

Hope that helps.

James


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to