项目涉及到要用perl解析excel。在网上搜了一下,又通过自己试验,简单的excel形式是可以通过的。
需要安装的cpan 包:
之后按照 Spreadsheet::ParseExcel的说明文档那个例子进行解析就基本可以了。
不过有个小问题是我的excel里如有中文,需要指定一下 Spreadsheet::ParseExcel::FmtUnicode 编码。
代码如下:
结果成功了。
注意: 作者说的很清楚: The Spreadsheet::ParseExcel module can be used to read information from Excel 95-2003 binary files.
所以要是2007的话, Spreadsheet::XLSX module instead.