使用spreadsheet-reader流式读取超大excel文件

github:https://github.com/nuovo/spreadsheet-reader

最近有一个读取超大excel文件的功能需求,使用的phpexcel,有严重的内存泄露问题,暂时还未找到解决方案。

spreadsheet-reader是流式读取excel的,对于大多数格式的excel都能正常的读取,且内存消耗很小。

 

PS:其中遇到的坑

xlsx文件一定要标准,也就是必须是offce生成的,而不是wps之类的……被这个坑了很久

如果不正确会出现如下报错,个人猜测是文件头问题,建议用office打开另存为一份就没问题了

 

Warning: XMLReader::open(): Empty string supplied as input in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 959

Warning: XMLReader::read(): Load Data before trying to read in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 995

Notice: Undefined variable: i in C:\myphp_www\PHPTutorial\WWW\test.php on line 10
Array ( ) 
Warning: XMLReader::read(): Load Data before trying to read in C:\myphp_www\PHPTutorial\WWW\spreadsheet-reader-master\SpreadsheetReader_XLSX.php on line 995

转载于:https://www.cnblogs.com/Lynwood/p/9417035.html

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值