Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Filereader prob, help most definatly needed!

807605Sep 10 2007 — edited Sep 10 2007
Hi everyone. Basically i have a little project to work on, i admit im not the best at java but im willing to try haha. Right basically i need to write a program that reads a text file and removes a html page from the text file, il show you an example of the text file so you can get a better understanding of what im attempting:

blahblahblah
<html>
I AM HTML CODE
</html>
blahblahblah

Basically i want to read this file then extract the html code and all the html data inside the html tags and put this data into another text file. I am not after an answer given to me on a plate, which i dnt expect to get haha but i would appreciate some pointers in the right direction, all i have so far is just a basic file reader set up:

import java.io.*;

public class fileviewer
{

public static void main (String args[])
{
try

{

FileReader file = new FileReader ("C:\\Documents and Settings\\Graeme\\Desktop\\fileviewer\\data.txt.txt");
BufferedReader buffer = new BufferedReader (file);

String textline = null;
while ((textline = buffer.readLine()) !=null)
System.out.println(textline);
buffer.close();
}

catch (IOException e)

{
System.out.println(e);
}


}
}

MOST appreciate any help guys!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 8 2007
Added on Sep 10 2007
4 comments
188 views