本文整理了Java中org.apache.poi.hwpf.HWPFDocument.getDocumentText()
方法的一些代码示例,展示了HWPFDocument.getDocumentText()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。HWPFDocument.getDocumentText()
方法的具体详情如下:
包路径:org.apache.poi.hwpf.HWPFDocument
类名称:HWPFDocument
方法名:getDocumentText
暂无
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.poi
/**
* Grab the text out of the text pieces. Might also include various bits of
* crud, but will work in cases where the text piece -> paragraph mapping is
* broken. Fast too.
*/
public String getTextFromPieces() {
String text = doc.getDocumentText();
// Fix line endings (Note - won't get all of them
text = text.replaceAll( "\r\r\r", "\r\n\r\n\r\n" );
text = text.replaceAll( "\r\r", "\r\n\r\n" );
if ( text.endsWith( "\r" )) {
text += "\n";
}
return text;
}
代码示例来源:origin: org.openl.rules/org.openl.lib.poi.dev
/**
* Grab the text out of the text pieces. Might also include various bits of
* crud, but will work in cases where the text piece -> paragraph mapping is
* broken. Fast too.
*/
public String getTextFromPieces()
{
String text = doc.getDocumentText();
// Fix line endings (Note - won't get all of them
text = text.replaceAll( "\r\r\r", "\r\n\r\n\r\n" );
text = text.replaceAll( "\r\r", "\r\n\r\n" );
if ( text.endsWith( "\r" ) )
{
text += "\n";
}
return text;
}
代码示例来源:origin: stackoverflow.com
import org.apache.poi.hwpf.HWPFDocument;
...
File fin = new File(yourFilePath);
FileInputStream fis = new FileInputStream(fin);
HWPFDocument doc = new HWPFDocument(fis);
String text = doc.getDocumentText();
System.out.println(text);
...
内容来源于网络,如有侵权,请联系作者删除!