If you want to process an input file section by section, with sections separated by blank lines, you could consider reading the file in paragraph mode. You can do this by changing the default input record separator to an empty string as shown here.
knoppix@Microknoppix:~$ perl -E ' > open my $inFH, q{<}, \ <<EOD or die $!; > VECT > 111 > 222 > 333 > > VECT > 444 > 555 > 666 > 777 > > VECT > 888 > 999 > EOD > > { > local $/ = q{}; > while ( <$inFH> ) > { > print; > say q{=} x 20; > } > }' VECT 111 222 333 ==================== VECT 444 555 666 777 ==================== VECT 888 999 ==================== knoppix@Microknoppix:~$
I hope this is helpful.
Cheers,
JohnGG
In reply to Re: splitting a large text file and output
by johngg
in thread splitting a large text file and output
by research_guy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |