in reply to Re^2: Creating .csv file with comma
in thread Creating .csv file with comma
#!/usr/bin/perl use strict; use warnings; use Text::CSV; my $number = "100"; my @data = (); push @data, [ '1234565', "Prototype", '"Number in address is '.$number.'. Please, Please check + your records."', ]; my $data = \@data; 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^4: Creating .csv file with comma
by haukex (Archbishop) on Apr 24, 2020 at 17:29 UTC | |
by Anonymous Monk on Apr 24, 2020 at 19:07 UTC | |
|
Re^4: Creating .csv file with comma
by soonix (Chancellor) on Apr 24, 2020 at 15:40 UTC |