File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Remove HTML tags from a text file? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Remove HTML tags from a text file?" Watch "Remove HTML tags from a text file?" New topic
Author

Remove HTML tags from a text file?

Harold Barnes
Greenhorn

Joined: May 04, 2005
Posts: 6
Any suggestions on an easy way to remove html tags from a text file? The only thing I can think of it to list the tags in an array and then replace occurences of them in the text file with nothing.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8836
    
    7

Do you mean get the text from an HTML file?


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
proper html only contains < and > for the tags, otherwise < and > are used. so you could just look for the '<' and stop appending until you see '>'.
Timmy Marks
Ranch Hand

Joined: Dec 01, 2003
Posts: 226
Or that.
 
 
subject: Remove HTML tags from a text file?
 
Similar Threads
Removing HTML tags
Library to remove HTML tags and comments
Removing html tags from a string
How can I write jsp lib that removes html tag
Get plain text content from HTML document?