Spreadsheet::ParseExcel::FmtJapan2 を使う
Spreadsheet::ParseExcel::FmtJapan2 を使う方法 on FreeBSD6.1.
いいドキュメントが見つからなかったので調べた。
導入
cpanから必要なモジュールをインストールする。
>perl -MCPAN -e shell install Spreadsheet::ParseExcel install Unicode::Map
からSpreadsheet::ParseExcel をダウンロードする。
解凍して、CP932Excel.map を取り出す
そんで、Unicode::Map のインストールされたディレクトリにコピーする
cp CP932Excel.map /usr/local/lib/perl5/site_perl/5.8.8/mach/Unicode/Map/MS/WIN/
それを書き込み、Unicode::Mapに関連付け完了
>vi /usr/local/lib/perl5/site_perl/5.8.8/mach/Unicode/Map/REGISTORY name: CP932Excel srcURL: $SrcUnicode/VENDORS/MICSFT/WINDOWS/CP932.TXT src: $DestUnicode/VENDORS/MICSFT/WINDOWS/CP932.TXT map: $DestMap/MS/WIN/CP932Excel.map
以上、ここまでやんなきゃダメ。面倒いけど。
その辺面倒なんだよな。Spreadsheet::ParseExcel::FmtJapan2。
使い方
use Spreadsheet::ParseExcel; use Spreadsheet::ParseExcel::FmtJapan2; my $xlsfile = "data.xls"; my $oExcel = new Spreadsheet::ParseExcel; my $oFmtJ = Spreadsheet::ParseExcel::FmtJapan2->new(Code => 'SJIS'); my $oBook = $oExcel->Parse($xlsfile, $oFmtJ); my @sheets = @{$oBook->{Worksheet}};
以下略