apache poi 与 python xlrd
我打算在 Linux 上使用 apache poi 或 python xlrd 来读取 Linux 上程序中的电子表格。我偏向于 python xlrd,但 apache poi 对我来说似乎是一个更完整的项目(可能是因为它受到 apache 基金会的支持)。什么是更好的选择(我偏向于 python,但仍然..)?我希望能够阅读大多数版本的 Excel 并读取宏。
I was going to use apache poi or python xlrd on linux to read spreadsheets in a program on linux. I am biased towards python xlrd but apache poi seems like a more complete project to me (probably since its supported by the apache foundation). What would be a better choice (I am biased towards python but still..) ? I would like to be able to read most of the versions of excel and read macros.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您需求的复杂程度,您可能只使用 Apache Tika CLI。 Tika 处理与 POI(和其他库)的对话,并向您返回文档的 XHTML 或纯文本版本。如果您只想要一个简单的 Linux 命令,那可能就足够了。
否则,这可能取决于您的 Java 技能。 POI 应该可以完成您需要的一切,但是您需要编写一些代码来获取您感兴趣的部分。查看快速指南来帮助您入门。
(我不知道xlrd,抱歉)
Depending on the complexity of your needs, you could potentially just use the Apache Tika CLI. Tika handles talking to POI (and other libraries) and will give you back a XHTML or plain text version of the document. If you just want a simple linux command, that might be good enough.
Otherwise, it may depend on what your Java skills are like. POI should do everything you need, but you'll need to write a bit of code to grab the bits that interest you. Have a look at the quick guide to get you started.
(I don't know about xlrd, sorry)
一种可能实现两全其美的选择是通过 Jython(带有 java 互操作的 python 语法)利用 Apache POI。
这里是一个过时的 jython 示例...我相信这需要随着新版本而改变兴趣点。
One option to potentially give the best of both worlds would be to leverage Apache POI via Jython (python syntax with java interop).
Here is a dated jython example... i believe this will need to be changed with the newer version of POI.