By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,541 Members | 1,109 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,541 IT Pros & Developers. It's quick & easy.

Converting word document file into text file

P: 33
hi all,
Can anyone direct me how to convert a MS word document file into a plain text file in java? No need to keep any kind of format; text alone required. Any sort of help is welcome. Thanks in advance.
Dec 19 '06 #1
Share this Question
Share on Google+
8 Replies


P: 26
I have a program that can convert word documents to RTF, TXT etc. If you want it send me a message, and I'll email it to ya.

Its written in C# though, not java.

hi all,
Can anyone direct me how to convert a MS word document file into a plain text file in java? No need to keep any kind of format; text alone required. Any sort of help is welcome. Thanks in advance.
Dec 19 '06 #2

10K+
P: 13,264
I have a program that can convert word documents to RTF, TXT etc. If you want it send me a message, and I'll email it to ya.

Its written in C# though, not java.
You can simply copy every line from the doc file into a new txt file. It's fairly straightforward using FileReader class.
Dec 19 '06 #3

P: 33
You can simply copy every line from the doc file into a new txt file. It's fairly straightforward using FileReader class.
It is not for only one file. The actual scenario is, the user will upload the document file and it should be converted into text file for further proces.

Also please tell me with FileReader how can we read text alone.
Thanks in advance...
Dec 19 '06 #4

Ganon11
Expert 2.5K+
P: 3,652
So what you're saying is, the .doc file may have extra formatting characters that will not function in Notepad (.txt format), and you want to know how to read just the text and ignore these extra characters?
Dec 19 '06 #5

10K+
P: 13,264
It is not for only one file. The actual scenario is, the user will upload the document file and it should be converted into text file for further proces.

Also please tell me with FileReader how can we read text alone.
Thanks in advance...
Sounds like you will also need a filechooser. Do the word documents contain text only?
Dec 19 '06 #6

10K+
P: 13,264
Sounds like you will also need a filechooser. Do the word documents contain text only?

Looks like Ganon beat me to the reply there.
Dec 19 '06 #7

P: 1
Could you please mail me the code on pradeep_mi@yahoo.com


I have a program that can convert word documents to RTF, TXT etc. If you want it send me a message, and I'll email it to ya.

Its written in C# though, not java.
Jan 7 '08 #8

10K+
P: 13,264
You can simply copy every line from the doc file into a new txt file. It's fairly straightforward using FileReader class.
Actually for reading .doc files, a third party package e.g Apache poi is probably best.
Jan 7 '08 #9

Post your reply

Sign in to post your reply or Sign up for a free account.