如何从 Perl 创建或读取 OpenOffice 电子表格?
在 Perl 中创建和读取 OpenOffice 电子表格的好方法是什么?
What is a good way to create and read an OpenOffice spreadsheet in Perl?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为 open Office 本机文档格式基于 OpenDocument 规范,并且基本上是一种 zip 压缩的 XML 格式。 如果确实如此,您可能可以使用您选择的 perl XML 操作工具来操作它。
或者,CPAN 上有 Open Office OpenDocument 连接器模块套件,为 OpenDocument 规范提供高级 API。
据我所知,这些模块中的表方法应该允许在 OO Calc 文档中读取和写入数据。
I think that the open office native document format is based around the OpenDocument specifications, and is bascially a zip compressed XML format. This being true you could probably manipulate it using your perl XML manipulation tools of choice.
Alternatively, there's the Open Office OpenDocument Connector suite of modules on the CPAN which offers a high level API to the OpenDocument spec.
To my knowledge, the table methods in these modules should allow for both reading and writing data in OO Calc documents.
我使用 OpenOffice::OOCBuilder 创建大型颜色编码表。 非常喜欢它。
对于更简单的任务,我经常使用任何电子表格程序都可以轻松打开的纯 CSV 格式。
但是,您可能会选择 Excel 格式以与其他人兼容。
I used OpenOffice::OOCBuilder for creating large color-coded tables. Liked it very much.
For simpler tasks, I often use plain CSV format that is readily opened by any spreadsheet program
However, you might chose the Excel stuff for compatibility with other people.
OpenOffice 支持多种格式,如果您正在寻找可以读取/写入与 Excel 兼容的电子表格的格式,请查看 Spreadsheet::ParseExcel 用于阅读,以及 Spreadsheet::WriteExcel 用于写入。 我都用过它们,它们非常成熟并且效果很好。
OpenOffice supports a number of formats, if you are looking for something that can read/write Excel-compatible spreadsheets check out Spreadsheet::ParseExcel for reading, and Spreadsheet::WriteExcel for writing. I have used them both, they are pretty mature and work well.
这是2.4版本的,因为最新版本不稳定。 但有时它确实可以与最新版本一起使用。 这将允许 Calc 中的实时 DDE 功能,而不是操作文件。 这是在 XP 上使用 Cygwin Perl,但应该可以与其他人一起使用。 我只想说 Excel VBA 编程 API 好 10 倍,混乱程度也低 10 倍。 那是相当糟糕的。
[代码]
[/代码]
This is with version 2.4, because the latest version is unstable. It does work with the latest though sometimes. This will allow realtime DDE features in Calc as opposed to manipulating files. This is using Cygwin Perl on XP but should work with others. I just want to say the Excel VBA programming API is 10 times better and 10 times less confusing. That is pretty bad.
[code]
[/code]