Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Incosistent delimeter

by trwww (Priest)
on Apr 21, 2011 at 02:25 UTC ( [id://900455]=note: print w/replies, xml ) Need Help??


in reply to Incosistent delimeter

$ cat csv.pl use warnings; use strict; use Text::CSV; use Data::Dumper; my $data = q|1, 2, 3,"a,b,c","d", 4|; my $csv = Text::CSV->new( {allow_whitespace => 1} ); $csv->parse($data); my @data = $csv->fields; print Dumper( \@data ), "\n"; $ perl csv.pl $VAR1 = [ '1', '2', '3', 'a,b,c', 'd', '4' ];

Don't forget exception handling!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-24 00:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found