aspose 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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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: 8870
    
    8

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.
 
Don't get me started about those stupid light bulbs.
 
subject: Remove HTML tags from a text file?