Don't ask to ask, just ask | |
PerlMonks |
Re: Regexp matching on a multiline file: dealing with line breaksby Athanasius (Archbishop) |
on Dec 06, 2015 at 04:48 UTC ( [id://1149491]=note: print w/replies, xml ) | Need Help?? |
Hello BlueStarry, and welcome to the Monastery! If the entire file will fit in memory, a variation on kennethk’s solution is to simply delete the newlines before searching:
Output:
However, as your input file is 5 GB, this approach is probably impractical. In which case you’re going to have to bite the bullet and implement a solution with “strange buffers” — such as a sliding window technique. Maybe have a look at Data::Iterator::SlidingWindow. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|