Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re^3: Getting columns from csv file in perl

by Joost (Canon)
on Apr 24, 2007 at 14:17 UTC ( #611742=note: print w/replies, xml ) Need Help??


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

*sigh*. Ok.
my @data = map { [split /,/] } <>;

Replies are listed 'Best First'.
Re^4: Getting columns from csv file in perl
by johngg (Abbot) on Apr 24, 2007 at 14:43 UTC
    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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://611742]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2017-01-17 07:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you watch meteor showers?




    Results (152 votes). Check out past polls.