Ok - I am looking at XLSX to see if I can make changes to remove stuff I dont need - since all i am trying to do in the production code is read the cell value and write it out to csv file
Can I eliminate all that excel style processing?
my $member_styles = $self -> {zip} -> memberNamed ('xl/styles.
+xml');
my @styles = ();
my %style_info = ();
if ($member_styles) {
foreach my $t ($member_styles -> contents =~ /xf\ numF
+mtId="([^"]*)"(?!.*\/cellStyleXfs)/gsm) { #"
# $t = $converter -> convert ($t) if $converter
+;
push @styles, $t;
}
my $default = $1 || '';
foreach my $t1 (@styles){
$member_styles -> contents =~ /numFmtId="$t1" formatCode="
+([^"]*)/;
my $formatCode = $1 || '';
if ($formatCode eq $default || not($formatCode)){
if ($t1 == 9 || $t1==10){ $formatCode="0.00000%";}
elsif ($t1 == 14){ $formatCode="m-d-yy";}
else {
$formatCode="";
}
}
$style_info{$t1} = $formatCode;
$default = $1 || '';
}
}
Also, I am considering reducing the cell object size by removing format and type hash keys
So change
}
my $cell =Spreadsheet::ParseExcel::Cell->new(
Val => $v,
Format => $thisstyle,
Type => $type
);
TO
}
my $cell =Spreadsheet::ParseExcel::Cell->new(
Val => $v
);
Please let me know what you think |