in reply to Re: Creating .csv file with comma
in thread Creating .csv file with comma
#!/usr/bin/perl use strict; use warnings; my $number = "100"; my @data; push @data, [ '1234565', "Prototype", '"Number in address is '.$number.'. Please, Please check + your records."', ]; my $csv = Text::CSV->new ( { binary => 1, eol => "\n", quote_char => +'', } ) or die "Cannot use CSV: ".Text::CSV->error_diag (); open my $fh, >, "myfile.csv" or die "Unable to create file: $!"; $csv->print($fh, $_) for @{ $data }; close $fh;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Creating .csv file with comma
by 1nickt (Canon) on Apr 24, 2020 at 19:33 UTC | |
|
Re^3: Creating .csv file with comma
by Anonymous Monk on Apr 24, 2020 at 14:51 UTC | |
by haukex (Archbishop) on Apr 24, 2020 at 17:29 UTC | |
by Anonymous Monk on Apr 24, 2020 at 19:07 UTC | |
by soonix (Chancellor) on Apr 24, 2020 at 15:40 UTC |