Subject: | Shared String not identifying proper Values, identified fix for it. |
Spreadsheet-XLSX version 0.09
perl version 5.6.4
sun sparc operating system (unix).
When parsing a formatted xlsx file that contains cells with different
formatting within a cell, the SharedString table is identifying the
below xml code as 2 separate Values, "RR" and "=Event Present", but in
face, they are from the same cell as "RR=Event Present".
- <si>
- <r>
<t>RR</t>
</r>
- <r>
- <rPr>
<i />
<sz val="8" />
<rFont val="Arial" />
<family val="2" />
</rPr>
<t xml:space="preserve">= Event Present</t>
</r>
</si>
---
this is how I fixed it.
open (SS, $sharedString) || die "Cannot open $sharedString $!\n";
$snum=0;
while (<SS>) {
chomp;s/\r//g;
while ($_ =~ /\<si\>(.*?)\<\/si\>/g) {
$inside = $1;
$totval = "";
while ($inside =~ /\<t( .*?|)\>(.*?)\<\/t\>/g) {
$val = $2;
$totval .= "$val";
}
$special{$snum}=$totval;
$snum++;
}
}
close (SS);