PrintWriter and Batch Processing

Discussion in 'Java' started by Sharp Tool, Jul 9, 2005.

  1. Sharp Tool

    Sharp Tool Guest

    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
    Sharp Tool, Jul 9, 2005
    #1
    1. Advertising

  2. In article <hnIze.28412$>,
    "Sharp Tool" <> wrote:

    > 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.

    --
    John
    jmatthews at wright dot edu
    www dot wright dot edu/~john.matthews/
    John B. Matthews, Jul 9, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Oz Levanon
    Replies:
    1
    Views:
    2,088
  2. Houman
    Replies:
    2
    Views:
    697
    Frank
    Aug 18, 2004
  3. Sharp
    Replies:
    5
    Views:
    392
    Paul Lutus
    Oct 15, 2004
  4. CamT
    Replies:
    1
    Views:
    4,389
    Oscar kind
    Mar 16, 2005
  5. yzzzzz

    Writer and PrintWriter

    yzzzzz, Mar 25, 2005, in forum: Java
    Replies:
    2
    Views:
    4,329
    yzzzzz
    Mar 25, 2005
Loading...

Share This Page