Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Incosistent delimeter

by trwww (Priest)
on Apr 21, 2011 at 02:25 UTC ( #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!


Comment on Re: Incosistent delimeter
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (8)
As of 2014-09-01 13:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (10 votes), past polls