Apache POI 提取文本

2025 年 3 月 17 日 | 阅读 1 分钟

为了从 Word 文档中提取文本,XWPFWordExtractor 类提供了一个 getText() 方法。此方法从文档中获取所有文本。

这是一个有用的方法,可以在 Java 程序中用来读取数据。

让我们看一个例子,我们从中提取文本的 doc 文件。

Apache POI 提取文本示例

输入


Apache POI Extract Text

输出

Apache POI (Poor Obfuscation Implementation) is a project design and developed by 
Apache Software Foundation. It is a collection of pure Java libraries, used to read
and write Microsoft office files such as Word, PowerPoint etc.