update text file

i want to update a particular line in a text file and aloso want to delete some data form the file please give me a suggestion.
[134 byte] By [Mainendraa] at [2007-10-3 10:23:15]
# 1
you could read the data from file, edit what you want, store the data into some sort of variable(write it to an array of strings or one large string), and rewrite the file over the old file.
sosleepya at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 2
i want to update the existing file.give me some code sample.
Mainendraa at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 3
> i want to update the existing file.> give me some code sample.mind your manners
georgemca at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 4
<mind your mannersLOL:P>
SvHa at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 5

> <mind your manners

>

> LOL:P

well, it's getting so tiresome now. there was a thread the other day, with a similar question, and about 2 minutes after it was created the poster added "answer immediately" to it

honestly, people, this is free support. take what you're given, as and when it's given

georgemca at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 6
> i want to update the existing file.> give me some code sample.You can do what was told in reply #1.If you want to update your file, delete the old file and make a new file with same name. When you prorgram exits it still looks like you updated the file.
lupansanseia at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 7
> give me some code sample.code sample of what?you read the file in.do the changes that u want.read the file out.where are u stuck?
SvHa at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...
# 8
I suggest you look for the line you want to replace by reading the file that you want to edit/update... Try using the RandomAccessFile Class. =)
Redxxiva at 2007-7-15 5:44:57 > top of Java-index,Java Essentials,New To Java...