#!/usr/bin/perl use strict; use warnings; use diagnostics; use Excel::Writer::XLSX;
Direct copy of example for use of module "Text::CSV_XS"
my $csv = Text::CSV_XS->new ({ binary => 1 });
open my $fh, "<", "a.csv" or die "a.csv: $!";
while (my $row = $csv->getline ($fh)) {
# do something with @$row
####
open my $fh_xlsx, ">", "write_to.XLSX" or die "write_to.XLSX: $!";
$fh_xlsx=1;
chomp $row;
print "@$row\n";
}
$csv->eof or $csv->error_diag;
close $fh or die "a.csv: $!";
close $fh_xlsx or die "write_to.XLSX: $!";