Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: joining lines

by jeffenstein (Hermit)
on Apr 23, 2002 at 14:56 UTC ( [id://161328]=note: print w/replies, xml ) Need Help??


in reply to joining lines

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"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://161328]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2024-04-19 15:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found