Replacing text in a text file

I need to be able to search and replace a line in a text file. Searching shouldnt be too hard to do, however, how do I replace all the text in a certain line.**Snippets of code are preferred, as well a web-site tutorials.Thanks in advance, Steven1350
[278 byte] By [Steven1350a] at [2007-11-27 10:08:17]
# 1
Read the file, for each line, either write it out as-is to a temp file or modify it in memory (for example, with String.replaceAll()), and then write it out. When done, remove the original and rename the temp file to the original name.
jverda at 2007-7-13 0:44:45 > top of Java-index,Java Essentials,Java Programming...
# 2
http://java.sun.com/docs/books/tutorial/essential/io/index.html
jverda at 2007-7-13 0:44:45 > top of Java-index,Java Essentials,Java Programming...