in reply to CSV file with double quotes
use strict; use warnings; use Text::CSV_XS; my $csv = Text::CSV_XS->new ({ binary => 1, auto_diag => 1, eol => "\n +" }); open my $fh, "<:encoding(utf-8)", "file.csv" or die "file.csv: $!"; while (my $row = $csv->getline ($fh)) { s/,/~z~/g for @$row; $csv->print (*STDOUT, $row); }
Simple enough?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: CSV file with double quotes
by rahulr (Initiate) on Sep 14, 2011 at 14:28 UTC | |
by chrestomanci (Priest) on Sep 14, 2011 at 15:19 UTC |