The stupid question is the question not asked | |
PerlMonks |
Re: Perl to convert a named workseet from an xlsx workbook with multiple worksheets into a csv fileby Tux (Canon) |
on Nov 22, 2014 at 09:36 UTC ( [id://1108088]=note: print w/replies, xml ) | Need Help?? |
It is VERY error prone to use join "," to write CSV from cell data: what if the cell contains a , (or a newline)? Use a CSV module to generate CSV file, like Text::CSV_XS or Text::CSV. If you use Spreadsheet::Read instead of your set of the three modules, you'd be able to pick a sheet by name. FWIW Spreadsheet::BasicRead requires the other two modules, but you do not have to include those requirements in your script). For reading xlsx spreadsheets, please use Spreadsheet::ParseXLSX (Spreadsheet::BasicRead (still) uses Spreadsheet::XLSX which is buggy and unmaintained). Any alternative will make you suffer later on. (Spreadsheet::Read uses Spreadsheet::ParseXLSX). Here is an example for using the modules (tested):
Enjoy, Have FUN! H.Merijn
In Section
Seekers of Perl Wisdom
|
|