Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: Getting columns from csv file in perl

by johngg (Abbot)
on Apr 24, 2007 at 14:43 UTC ( #611749=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Getting columns from csv file in perl
in thread Getting columns from csv file in perl

my @data = map { [split /,/] } <>;

You might want a chomp in there to avoid leaving the line terminator in the last field.

my @data = map { chomp; [split /,/] } <>;

I second your *sigh* by the way.

Cheers,

JohnGG


Comment on Re^4: Getting columns from csv file in perl
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2015-07-28 04:49 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 (252 votes), past polls