PrintWriter and Batch Processing

S

Sharp Tool

Hi

I have a program that I call repeatedly with Java.
The program will analyse data and write a line of results to a text file.
I would like to keep writing to the same file.
How can this be done?

Tried:
Everytime I create a PrintWriter and pass the filename to it, it will
rewrite previous data - its starts off from scratch again.

Help is appreciated.

Cheers
Sharp Tool
 
J

John B. Matthews

Sharp Tool said:
Hi

I have a program that I call repeatedly with Java.
The program will analyse data and write a line of results to a text file.
I would like to keep writing to the same file.
How can this be done?

Tried:
Everytime I create a PrintWriter and pass the filename to it, it will
rewrite previous data - its starts off from scratch again.

Help is appreciated.

Cheers
Sharp Tool

The constructor FileOutputStream(File file, boolean append) may be what
you're looking for.
 

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,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top