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

How To Convert HTML file into a Text file

P: 1
Hai,

I have a small task.
I have an .HTML file.
I wanted to convert .HTML file into a plain .txt file.
Means after i convert the file, the .txt file should contain only the text rather
than the HTML tags information.
If you have a solution please guild me.

Bi.
Dec 31 '07 #1
Share this Question
Share on Google+
1 Reply


Expert 10K+
P: 11,448
Hai,

I have a small task.
I have an .HTML file.
I wanted to convert .HTML file into a plain .txt file.
Means after i convert the file, the .txt file should contain only the text rather
than the HTML tags information.
If you have a solution please guild me.

Bi.
Use an HTMLEditorKit and an HTMLDocument; the editor can load
the textual representation in the document and the document can return the raw
text to you. If I remember well it simply strips <br> tags (I consider that buggy)
so you might need to insert new lines back into your string for them.

kind regards,

Jos
Dec 31 '07 #2

Post your reply

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