in reply to Re: Parsing a .xlsx file with chinese characters
in thread Parsing a .xlsx file with chinese characters
At the moment I am just using the synopsis code found on the Spreadsheet::XLSX cpan page
use Spreadsheet::XLSX; my $excel = Spreadsheet::XLSX -> new ('sample.xlsx'); foreach my $sheet (@{$excel -> {Worksheet}}) { printf("Sheet: %s\n", $sheet->{Name}); $sheet -> {MaxRow} ||= $sheet -> {MinRow}; foreach my $row ($sheet -> {MinRow} .. $sheet -> {MaxRow}) { $sheet -> {MaxCol} ||= $sheet -> {MinCol}; foreach my $col ($sheet -> {MinCol} .. $sheet -> {Max +Col}) { my $cell = $sheet -> {Cells} [$row] [$col]; if ($cell) { printf("( %s , %s ) => %s\n", $row, $col, +$cell -> {Val}); } } } }
This output everything fine including more standard Unicode characters however with the Chinese characters it output characters like 礼 司天 instead. I know it is a problem with how I am using the module as I managed to get a script working ok with Spreadsheet::Parse Excel and a .xls file however my work requires the files to be .xlsx and so I can not use this script
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: Parsing a .xlsx file with chinese characters
by anneli (Pilgrim) on Oct 03, 2011 at 07:41 UTC | |
by Sithiris (Novice) on Oct 03, 2011 at 21:32 UTC | |
by anneli (Pilgrim) on Oct 05, 2011 at 04:44 UTC | |
by Sithiris (Novice) on Oct 05, 2011 at 21:17 UTC | |
by anneli (Pilgrim) on Oct 05, 2011 at 21:55 UTC | |
|
In Section
Seekers of Perl Wisdom