Question about input, reading, correcting, and outping a file

I am looking to create a workaround to fix my RSS feed for my blog. Currently I am using Godaddy's free hosting, and I don't mind the banners at all.. I just would like to have my rss feed validate.

My feed is ok but for the few lines only at the end of the source to my feed. I have been able to view the source, and then copy all then delete the script for the banner. After this I save and upload to the server.

My real question is who do I have the read the source of the file up from the bottom to the start of the script and delete the script to the bottom?

Thank you for your time, and have a great day!

~Keith

[653 byte] By [wsulinuxa] at [2007-11-27 2:24:21]
# 1
Call me stupid, but I really don't understand your question:My real question is who do I have the read the source of the file up from the bottom to the start of the script and delete the script to the bottom?
Tavea at 2007-7-12 2:31:15 > top of Java-index,Java Essentials,New To Java...
# 2

well I am trying to use the basic application setup with a file reader.

Then I am setting a while loop with the .hasNext() to count the number lines in the file.

From that number I having the program output all of the lines, but the last three lines. The last three lines are where the banner script is added.

I have tried this and it works great. Now I just need to see if anyone can help me on getting the program to input a file from the net. I am able to input a file from the local disks, but not straight from the net.

By the way man your not Stupid unless you assign yourself that value.

Thanks for the help.

~Keith

wsulinuxa at 2007-7-12 2:31:15 > top of Java-index,Java Essentials,New To Java...
# 3

if you want to read the file from the net follow this.

URL url = new URL("http://www.google.com");

URLConnection urlConnection = url.openConnection();

urlConnection.connect();

InputStream inStream = urlConnection.getInputStream();

BufferedInputStream binStream = new BufferedInputStream(inStream);

int i = 0;

byte []b = new byte[128];

File file = new File("google.htm");

FileOutputStream fout = new FileOutputStream(file);

while(i != -1){

i = binStream.read(b);

if(i > 0)

fout.write(b);

System.out.print(new String(b));

}

fout.close();

This will save the file on local machine.

You can edit it before or after saving to the disk.

Then you can decide what to do with it.

As you said you want to remove the last 3 lines. Instead of removing the last 3 lines search for the script which shows the banner and then remove it.

jawadhashmia at 2007-7-12 2:31:15 > top of Java-index,Java Essentials,New To Java...