in reply to Parsing a file in "chunks"

UPDATE: The OP was changed in a major way after my original reply. This no longer applies...

It seems like you just want to ignore your datestamp lines:

use strict; use warnings; while (<DATA>) { next if /\[datestamp\[/; print if /crap/; } __DATA__ [datestamp] [DEBUG] something here [datestamp] [DEBUG] something else here [datestamp] [ERROR] blah blah <chunk of crap> [datestamp] [INFO] bla bla bla

Replies are listed 'Best First'.
Re^2: Parsing a file in "chunks"
by vxp (Pilgrim) on Aug 04, 2010 at 20:37 UTC
    no, cant ignore them this is needed for the script to be able to say something like: there were 17 sqlexception errors within the past 15 mins. or - only 1 suchandsuch error within the past 7 minutes from now. etc