in reply to Split files based on regexp
Here's some meta-code that should show the logic of how I'd approach this:
my $in_combat = 0; #open the file for input LINE: while (my $line=readline($input_file)) { if (# line contains start-combat flag) { $in_combat = 1; } next LINE if (!$in_combat); # do stuff with lines *during* combat--beginning and end will be he +re, too! if (#line contains end-combat flag) { $in_combat = 0; } } # close files, etcetc
TIMTOWTDI, of course.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split files based on regexp
by roboticus (Chancellor) on May 17, 2012 at 12:11 UTC | |
by druthb (Beadle) on May 17, 2012 at 12:43 UTC |