in reply to Re^2: how to modify a field in a CSV file
in thread how to modify a field in a CSV file
I'm trying to retain the double quotes and the comma delimiters that were part of the input file. I'd like to think that I can do this with text::csv_xs
Sure, see combine().
my $csv = Text::CSV->new ( { quote_space => 0 } ) or die "Cannot use CSV: ".Text::CSV->error_diag (); my @columns = ("What, a nice day", "This is a fence", "Here is an,and +day"); print $csv->string() if $csv->combine(@columns);
generates the following line:
"What, a nice day",This is a fence,"Here is an,and day"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: how to modify a field in a CSV file
by beerman (Novice) on Sep 02, 2011 at 20:25 UTC | |
by Tux (Canon) on Sep 02, 2011 at 22:21 UTC |