To output values to the same file for different outputs

R

ram

Hi,

I'm running a program which would take few values and writes them to
output file which is text file. For next run those values are changed
and run. I want the previous run values and the current run values on
the same file how could that be done?Please let me know.
 
D

Daniel Pitts

ram said:
Hi,

I'm running a program which would take few values and writes them to
output file which is text file. For next run those values are changed
and run. I want the previous run values and the current run values on
the same file how could that be done?Please let me know.
Simply open the file for appending.
 
C

chinmoy.titan

Please do not top-post.


Exactly what the OP was told in the other thread they started on this same
question.

Hi,
You can do the following:
FileWriter fwr = new FileWriter("name of file",true);

The second parameter is a boolean valye and if it is true it will
search the file and if the file is there it will append the new values
instead of overwriting. u can write into the file by using

fwr.write(string);

Let me know if this solves ur problem.else u can drop a mail to me....
Chinmoy...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,187
Latest member
RosaDemko

Latest Threads

Top