If it will always be a constant number of fields per line, you could do something like this:
while(<>){ chomp; my @line = split /\|/; while( @line < 4 ){ $_ .= <>; chomp; @line = split /\|/; } if( @line > 4){ warn "Found line with too many elements"; } print join "|", @line; print "\n"; }
In reply to Re: joining lines
by jeffenstein
in thread joining lines
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |