Subject: | Cell value read as GENERAL in LibreOffice-created XLSX |
I found that XLSX spreadsheets created in LibreOffice 4.4 aren't parsed correctly by Spreadsheet::XLSX. The formatted value is reported as GENERAL instead of the correct value.
Microsoft Excel doesn't seem to have any problem opening the file. Also, if I just open the file in Excel and Save As (without changing anything), the new file is parsed correctly.
Here's an example. I created libreoffice.xlsx in LibreOffice 4.4.7.2. The first column uses the default format to store 1. The second column uses an explicit integer format to store 2. The third column uses a two-decimal-place format to store 3.4. Then I dump the file with this code:
use Spreadsheet::XLSX ();
my $excel = Spreadsheet::XLSX->new(shift);
my $sheet = $excel->worksheet(0);
for my $col (0 .. 2) {
printf "%d: %s\n", $col, $sheet->get_cell(1,$col)->value;
}
For libreoffice.xlsx, this prints:
0: GENERAL
1: 2
2: 3.40
After loading & saving in Excel, libreoffice-excel.xlsx prints:
0: 1
1: 2
2: 3.40
which is correct.
Subject: | libreoffice-excel.xlsx |
Download libreoffice-excel.xlsx
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 7.5k
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet 7.5k
Message body not shown because it is not plain text.
Subject: | libreoffice.xlsx |
Message body not shown because it is not plain text.