阅读在java中.docx文件 [英] Reading .docx file in java
本文介绍了阅读在java中.docx文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想读在java中一个文件,下面是code:
I am trying to read one file in java, following is the code :
public void readFile(String fileName){
try {
BufferedReader reader= new BufferedReader(new FileReader(fileName));
String line=null;
while((line=reader.readLine()) != null ){
System.out.println(line);
}
}catch (Exception ex){}
}
这是TXT文件的情况下正常工作。然而,在的docx文件的情况下,它是印刷怪异字符。我如何在Java中读取.docx文件。
It is working fine in case of txt file. However in case of docx file, it is printing weird characters. How can i read .docx file in Java.
推荐答案
您可能要检查的Apache POI
这篇关于阅读在java中.docx文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文