I want the source code in java to convert a html file to a plain text file.Reply soon.Thanq
Printable View
I want the source code in java to convert a html file to a plain text file.Reply soon.Thanq
You can use regular expressions (java.util.regex package) if the tags are easy to identify in your documents.
If html used in a complex way in your documents (e.g. if they might have invalid html like not having some closing tags), then you should use a library to parse the html document. I recommend you to use an html parser. They are easy to use.
And if you dont want to use an additional library in your project, you can try using Swing HTML Parser.
I want to convert html file to text by giving it's URL as input.Plz give me the complete source code for it in JAVA if anybody can.Reply soon.Thanq
Check this tutorial for downloading web page from an URL.Quote:
I want to convert html file to text by giving it's URL as input.