I dont have time to write out the code but my approach would be as follows
#open the log #loop through $chunk_string = ""; while ($line = <FILE>) { #do any formatting (chomp etc) if ($line =~ /datestamp/) #appropriate regex here { if ($chunk_string =~ /whateveryouarelookingfor/) { #you found it in the current chunk } $current_datestamp = $1; #update the datestamp $line =~ s/$current_datestamp//; #ignore the date $chunk_string = ""; #reset the chunk. } $chunk_string .= $line; #add the line to the current chunk. }
In reply to Re: Parsing a file in "chunks"
by zek152
in thread Parsing a file in "chunks"
by vxp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |