This should be close to what you require:
#!/usr/bin/perl use strict; use warnings; open TEST, '<', 'tests.txt' or die "Cannot open 'tests.txt' $!"; open OUTPUT, '>', 'output1.txt' or die "Cannot open 'output1.txt' $!"; my $data; while ( <TEST> ) { if ( /SUBSCRIBER/ .. /NATIONAL/ ) { $data .= $_; next; } if ( length $data && $data =~ /A1/ ) { print OUTPUT $data; $data = ''; } } close TEST; close OUTPUT;
In reply to Re: Text Extraction
by jwkrahn
in thread Text Extraction
by JonDepp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |