in reply to Possible to have regexes act on file directly (not in memory)
Does your input file have any concept of logical records? Or how about this: Would your regex have any literal anchor that can be known ahead of time?
It could be that "newlines" are an infrequent occurrence. But maybe there is some other possible concrete point of reference that could be used as a record separator so that you're reading in smaller chunks that have some logical relationship to one another.
If that turns out to not be the case, then I suppose your best solution will be the one others have mentioned; determine what the largest possible "match" could be, set your chunk size to that size, and read a starter chunk. Then read a second chunk, concatenate them, do a pattern match, discard the first chunk, read a third, concatenate, match, repeat.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Possible to have regexes act on file directly (not in memory)
by Laurent_R (Canon) on May 02, 2014 at 22:28 UTC |