Results 1 to 3 of 3
  1. #1
    doymand is offline Member
    Join Date
    Oct 2010
    Rep Power

    Default Writing output file

    I made a OneTimePad program and want to output the encrypted message to a text file from a string. I want to keep a running log of the output so it stores the string again after each iteration of the program.

    Just looking for a little push in the right direction as to what I should be doing.
    Last edited by doymand; 11-04-2010 at 04:21 AM.

  2. #2
    Zack's Avatar
    Zack is offline Senior Member
    Join Date
    Jun 2010
    Destiny Islands
    Rep Power


    You basically just want to write a string to a text file?

    Have a look at the Java I/O API. It talks about files, paths, input/output, and so on. It's a great place to start, at the very least.
    Lesson: Basic I/O (The Java™ Tutorials > Essential Classes)

  3. #3
    Lund01's Avatar
    Lund01 is offline Senior Member
    Join Date
    Sep 2010
    The Netherlands
    Rep Power


    I use printWriter to write something to a .txt file.
    First I make a file, and later I let the program write things into the file

    Java Code:
    File output = new File("File1.txt");
    PrintWriter output1 = new PrintWriter("File1.txt");
    Java Code:
    output1.println("Text here that needs to the file1");
    Maybe this helps?

Similar Threads

  1. Replies: 0
    Last Post: 09-30-2010, 08:16 PM
  2. Writing a block of text as it is to output file
    By bikashg in forum New To Java
    Replies: 5
    Last Post: 05-29-2010, 11:38 PM
  3. Replies: 1
    Last Post: 02-27-2010, 01:29 AM
  4. Help in writing the output in html file
    By aks.nitw in forum Advanced Java
    Replies: 5
    Last Post: 01-18-2010, 01:33 PM
  5. Writing an XML output
    By JThangiah in forum XML
    Replies: 2
    Last Post: 03-27-2008, 04:15 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts