Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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 lurking in the Monastery: (7)
As of 2015-07-04 08:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (58 votes), past polls