简体   繁体   English

使用Spreadsheet :: XLSX进行XLSX解析

[英]XLSX parsing using Spreadsheet::XLSX

I have a script that will do parsing for xls like: 我有一个脚本,将解析xls,如:

$parser = Spreadsheet::ParseExcel->new(
                                     CellHandler => sub {$self->handle_cell(@_) },
                                     NotSetCell  => 1
                                        );

Now I am modifying this to parse xlsx file and it seems like xlsx file will not take any parameters in new() 现在我修改它来解析xlsx文件,似乎xlsx文件不会在new()使用任何参数

And handle_cell function, we get sheet_index and workbook and handle_cell函数一样,我们得到了sheet_index和workbook

 $worksheet = $workbook->Worksheet($sheet_index); $worksheet->row_range(); 

I want to give parameters like CellHandler and NotSetCell to Spreadsheet::XLSX also. 我想将像CellHandler和NotSetCell这样的参数提供给Spreadsheet::XLSX But I came to know that Spreadsheet::XLSX doen't take any parameters. 但我知道Spreadsheet::XLSX不带任何参数。 Do we have any other Perl module that acts same as Spreadsheet::ParseExcel but for parsing xlsx? 我们是否有任何其他Perl模块与Spreadsheet :: ParseExcel相同但是用于解析xlsx?

Please help me in this. 请帮帮我。 Is there any other Perl module for parsing xlsx by passing arguments to new()? 是否有任何其他Perl模块通过将参数传递给new()来解析xlsx?

There's a project started at github: Excel-Reader-XLSX . 在github上开始了一个项目: Excel-Reader-XLSX It isn't fancy but it works. 这不是花哨但它有效。

Yes. 是。 This is what I use. 这就是我使用的。

It has an api like the parse excel module, and can deal with xlsx files. 它有一个像解析excel模块一样的api,可以处理xlsx文件。 Look through the doc. 仔细阅读文档。 There is a paragraph or two about things you can do to reduce the memory foot print. 有一两段关于你可以做些什么来减少记忆足迹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用Excel :: XLSX解析Perl中的电子表格 - Using Excel::XLSX to parse a spreadsheet in Perl 如何使用“Excel::Writer::XLSX”阅读器将 .xlsx 单元格的格式复制到使用“Spreadsheet::WriteExcel”编写器的复制单元格? - How to copy the format of the .xlsx cell using "Excel::Writer::XLSX" reader to the copied cell using "Spreadsheet::WriteExcel" writer? 无法在Perl中使用Spreadsheet :: XLSX模块读取libra excel文件 - Unable to read libra excel file using Spreadsheet::XLSX module in Perl 无法使用Spreadsheet :: Read解析xlsx - unable to parse xlsx with Spreadsheet::Read 无法使用ppm与ActivePerl v5.22.1一起安装Spreadsheet :: ParseXLSX或Spreadsheet :: XLSX - Inability to install Spreadsheet::ParseXLSX or Spreadsheet::XLSX using ppm with ActivePerl v5.22.1 Perl-Spreadsheet :: XLSX-> New()在大文件上缓慢 - Perl - Spreadsheet::XLSX -> New () slow on big files 将.XLSX电子表格转换为CSV的代码无法正常工作 - Code to convert .XLSX spreadsheet to CSV is not working as expected 使用perl中的Excel :: Writer :: XLSX构建正确的电子表格 - Proper spreadsheet build with Excel::Writer::XLSX in perl 使用 Spreadsheet::XLSX,如何将格式从一个工作表复制到另一个? - Using Spreadsheet::XLSX, how do I copy formats from one worksheet to another? Perl SpreadSheet :: XLSX错误:“无法作为Zip存档打开” - Perl SpreadSheet::XLSX Error: “Cannot open as Zip Archive”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM