in reply to Perl to Add newline at the end of each row of comma seperated strings in an array ?

Consider using Text::CSV to create the csv

#!perl use strict; use warnings; use Spreadsheet::BasicRead; use Text::CSV; my $xlsx_INFILE = 'c:/temp/test3.xlsx'; my $ss = Spreadsheet::BasicRead->new( fileName => $xlsx_INFILE, skipBlankRows => 1 ) or die "Could not open '$xlsx_INFILE': $!"; my $csv = Text::CSV->new ( { binary => 1, eol => $/ } ) or die "Cannot use CSV: ".Text::CSV->error_diag(); my %seen; while ( my $data = $ss->getNextRow() ) { my $line = join '~',@$data; next if $seen{$line}++; $csv->print(*STDOUT, $data); }
poj
  • Comment on Re: Perl to Add newline at the end of each row of comma seperated strings in an array ?
  • Download Code