http://www.perlmonks.org?node_id=1031405

TravelAddict has asked for the wisdom of the Perl Monks concerning the following question:

Hi, I'm trying to write a script to read hundreds of Excel (XLSX) files and merging all the rows into a new file, while adding one column for the original file name. For that I'm using what I think are the correct XLSX parser and writer:
use Spreadsheet::XLSX; use Excel::Writer::XLSX;
The problem that I have is that the original cells that I'm reading are all formatted and I want to preserve the exact same format in the resulting Excel file. Using a couple of loops, I check every cell of the source files and I write them into the new file:
my $cell_data = $cell -> {Val}; $worksheet->write($row, $col, "$cell_data");
Unfortunately, I'm only getting the data inside the cells (text only) and I'm losing the bold, font, colors, etc. Is there a way to read a cell and copy it "as is" without having to read and transfer all the formatting information? Thanks!