in reply to OpenOffice::OODoc. Slow access to a cell content with getCellValue
You could try using the getTableText method to fill an array.
poj#!/usr/bin/perl use strict; use OpenOffice::OODoc; use Data::Dump 'pp'; my $doc = odfDocument(file => "myspreadsheet.ods"); open (my $out, '>', "outfile.txt") or die $!; foreach my $sheetno (0...$doc->getTableList-1){ my $table = $doc->getTable($sheetno,'normalize'); my ($rows,$cols) = $doc->getTableSize($table); my @text = $doc->getTableText($table); #pp @text; print "Sheet=$sheetno rows=$rows cols=$cols\n"; foreach my $rowno (0...$rows-1){ foreach my $colno (0...$cols-1){ my $value = $text[$rowno][$colno]; next if $value eq ''; print $out $value,"\n" } print $out "\n"; } };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OpenOffice::OODoc. Slow access to a cell content with getCellValue
by pvaldes (Chaplain) on Jun 01, 2016 at 22:33 UTC | |
by poj (Abbot) on Jun 02, 2016 at 06:43 UTC | |
by pvaldes (Chaplain) on Jun 02, 2016 at 11:24 UTC |