Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 07-07-2007, 12:18 PM
Member
 
Join Date: Jun 2007
Posts: 13
vissu007 is on a distinguished road
convert html to plain text
I want the source code in java to convert a html file to a plain text file.Reply soon.Thanq
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 07-07-2007, 12:57 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
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.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 07-07-2007, 04:20 PM
Member
 
Join Date: Jun 2007
Posts: 13
vissu007 is on a distinguished road
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
Bookmark Post in Technorati
Reply With Quote
  #4 (permalink)  
Old 07-07-2007, 04:39 PM
JavaBean's Avatar
Moderator
 
Join Date: May 2007
Posts: 1,272
JavaBean is on a distinguished road
Quote:
I want to convert html file to text by giving it's URL as input.
Check this tutorial for downloading web page from an URL.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
HSSF: Html to Text conversion xtech Advanced Java 1 04-17-2008 10:45 AM
convert html to text using java praveen@asia-mail.com New To Java 1 11-14-2007 04:08 PM
convert a lot of images into a single one leonard New To Java 1 08-06-2007 06:47 PM
map javax.swing.text.Element to javax.swing.text.View elizabeth New To Java 1 07-30-2007 09:02 PM
Convert .java to .exe susan New To Java 1 07-25-2007 09:26 PM


All times are GMT +3. The time now is 11:29 AM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org