Another way would be to accumulate the chunks as you read the file.
$ for i in `seq 1 13`; do echo Line $i; done | perl -e ' while ( not eof STDIN ) { my $buf; $buf .= $_ for map { eof STDIN ? () : scalar <> } 1 .. 5; print $buf; print q{+} x 10, qq{\n}; }' Line 1 Line 2 Line 3 Line 4 Line 5 ++++++++++ Line 6 Line 7 Line 8 Line 9 Line 10 ++++++++++ Line 11 Line 12 Line 13 ++++++++++ $
I hope this is of interest.
Cheers,
JohnGG
In reply to Re: Split string after 14 Line Feeds?
by johngg
in thread Split string after 14 Line Feeds?
by johnfl68
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |