#!/usr/bin/perl -w use strict; use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::FmtJapan; my $parser = Spreadsheet::ParseExcel->new(); my $formatter = Spreadsheet::ParseExcel::FmtJapan->new(); my $workbook = $parser->parse('file.xls', $formatter); if ( !defined $workbook ) { die $parser->error(), ".\n"; } for my $worksheet ( $workbook->worksheets() ) { print "Worksheet name: ", $worksheet->get_name(), "\n\n"; my ( $row_min, $row_max ) = $worksheet->row_range(); my ( $col_min, $col_max ) = $worksheet->col_range(); for my $row ( $row_min .. $row_max ) { for my $col ( $col_min .. $col_max ) { my $cell = $worksheet->get_cell( $row, $col ); next unless $cell; # Do something with $cell->value() and remember to enc +ode # any output streams if required. } } } __END__
Ignore that fact that it says FmtJapan, it is a general purpose Unicode formatter as well.
--
John.
In reply to Re: Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel
by jmcnamara
in thread Handling variety of languages/Unicode characters with Spreadsheet::ParseExcel
by richb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |