Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Read Text line by line & modify with a delimiter

by LanX (Canon)
on Dec 20, 2012 at 21:14 UTC ( #1009804=note: print w/ replies, xml ) Need Help??


in reply to Read Text line by line & modify with a delimiter

please use <code>tags for your examples

I think you want(?) this:

open my $fh,"<","textfile"; my @lines = <$fh>; close $fh; print join "|", @lines;

untested!

Cheers Rolf


Comment on Re: Read Text line by line & modify with a delimiter
Select or Download Code
Re^2: Read Text line by line & modify with a delimiter
by Anonymous Monk on Dec 21, 2012 at 00:01 UTC
    thx for doing my homework! :)
Re^2: Read Text line by line & modify with a delimiter
by Anonymous Monk on Dec 21, 2012 at 04:25 UTC

    Thx, but what can we do if the name contains a leading space or trailing space and I want to delete those spaces?

    Thx for your help.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2014-07-23 03:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (133 votes), past polls