POI按行读取word,并去掉属性标签内容:超链接
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                POI按行读取word,并去掉属性标签内容:超链接
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.                        
                                public String readDoc(File file) {
        StringBuffer buffer = new StringBuffer();
        InputStream input = null;
        WordExtractor extractor = null;
        String[] paragraphs = null;
        try {
            input = new FileInputStream(file);
            extractor = new WordExtractor(input);
            paragraphs = extractor.getParagraphText();
            for (String paragraph : paragraphs) {
                buffer.append(extractor.stripFields(paragraph)).append("\\
");
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (input != null) {
                try {
                    input.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
        return buffer.toString();
    }
    
剔除方法:extractor.stripFields(paragraph);
提取文檔內容文章。excel,pdf,word.....
http://blog.sina.com.cn/s/blog_67b9ad8d01010bwa.html
出現問題文章:
http://bbs.csdn.net/topics/320055955
總結
以上是生活随笔為你收集整理的POI按行读取word,并去掉属性标签内容:超链接的全部內容,希望文章能夠幫你解決所遇到的問題。
 
                            
                        - 上一篇: 骁龙8+新旗舰!一加10T入网:配备16
- 下一篇: samtools的基本用法
