问题描述
哪些更好的API用于在Apache Apache POI或JExcel API中进行excel解析?
在速度,内存利用率和代码稳定性方面。
Which is better API for excel parsing in Java Apache POI or JExcel API?In terms of speed, memory utilization and code stability.
推荐答案
我个人建议通过JExcel进行POI。我选择POI超过JExcelAPI的原因是:
Personally I would recommend POI over JExcel. The reasons I chose POI over JExcelAPI are:
- POI支持旧的和新的MS Excel表单格式
- 它有一个更干净的API(imho)
- 据我所见,它并没有遭受JexcelApi所带来的令人厌烦的Date\Time问题()。
- POI supports both old and new MS Excel sheet formats
- It has a cleaner API (imho)
- As far as I can see it does not suffer from the irritating Date\Time issues that JexcelApi has (Date display).
我有机会使用两者。 POI,在我看来,有一个非常深思熟虑和易于使用的API。从我的角度来看,最大的好处是,您可以将工作表实例的创建放在工厂,然后在美图形界面的上下文中处理所有内容。这意味着您的代码可以处理旧的和新的Excel文件格式,而不必担心哪个是哪个。
I have had the opportunity to use both. POI, in my opinion, has a really well thought out and easy to use API. The biggest benefit from my perspective is that you can factory off the creation of the worksheet instance and then deal with everything in the context of the usermodel interfaces. This means your code can process both old and new Excel file formats without having to worry about which is which.
此外,您可以读写相同的Worksheet实例。有了JExcelApi,我发现可读表和可写表之间真的很奇怪。这也导致我不得不引入杂乱无章的工作,从我的代码中的阅读转向写。
Additionally, you are able to read and write the same Worksheet instance. With JExcelApi there is this really strange split between "readable" sheets and "writable" sheets which I found odd. This also resulted in me having to introduce messy work arounds to move from "reading" to "writing" in my code.
我没有注意到有意义的性能差异使用POI旧的二进制文件(POI HSSF)和JExcelApi。然而,POI HSSF(旧格式)和POI XSSF(新格式)之间存在显着的性能差异。我假设这是因为拆包和解析XML所需的所有额外工作。
I did not notice meaningful performance difference using POI on old, binary files (POI HSSF) and JExcelApi. There is however a significant performance difference between POI HSSF (old format) and POI XSSF (new format). I assume this is because of all the extra work required for unpacking and parseing XML.
这篇关于哪个更好的开源的Excel文件解析在Java?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!