简体   繁体   中英

What is the best way to convert docx or doc file into txt in java?

I have tried to find a good way to convert but all off them not working with all the external jars that I'm required to add. Is there any one who knows easy / possible solution?

the best way is not. a doc(x) file can contain other than plain-text content, while a txt file can't.

what you could do, if you only need the text, is to use apache poi to read all the text from your doc(x) file, and a basic FileWriter to write it to a txt file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM