perl判断Excel单元格是否是合并单元格

#!/usr/bin/perl -w

use strict;
use Spreadsheet::ParseExcel;

my $parser = Spreadsheet::ParseExcel->new();
my $pWorkbook = $parser->Parse('ExcelName.xls');
my $pWorksheet = $pWorkbook->Worksheet('SheetName');

my $cell = $pWorksheet->Cell(35, 1);    #Cell(row, col), start with 0
my $meged = $cell->{'Merged'};

print defined($meged) ? "$meged\n" : "<undef>\n";

【参考文献】:

[1]. Perl官方网站
[2]. CPAN for ParseExcel

posted @ 2013-02-28 16:17  朝雾之归乡  阅读(1169)  评论(0编辑  收藏  举报