Results 1 to 3 of 3
  1. #1
    puk284 is offline Member
    Join Date
    Apr 2009
    Posts
    16
    Rep Power
    0

    Default Saving Console content to a file

    Hi,

    I have written a program that outputs numerical results to the console in java(using eclipse). The problem that i have is that i want to copy or save the entire console content to a .txt file. How could i do this please? Thank you for your help

  2. #2
    OrangeDog's Avatar
    OrangeDog is offline Senior Member
    Join Date
    Jan 2009
    Location
    Cambridge, UK
    Posts
    838
    Rep Power
    6

    Default

    When you run the application, redirect stout to the file you want.
    Java Code:
    java ClassName >file.txt
    If in eclipse, you can just copy the contents of the console.
    Don't forget to mark threads as [SOLVED] and give reps to helpful posts.
    How To Ask Questions The Smart Way

  3. #3
    ron87 is offline Member
    Join Date
    Mar 2009
    Posts
    52
    Rep Power
    0

    Default

    you can configure out object in system class
    check out setOut() method in system class.

Similar Threads

  1. Problem Saving a file
    By GraemeH in forum New To Java
    Replies: 1
    Last Post: 04-09-2009, 12:14 AM
  2. Saving ArrayList to File
    By nwboy74 in forum Advanced Java
    Replies: 6
    Last Post: 12-08-2008, 10:19 AM
  3. Saving to a Text File
    By jadaleus in forum Advanced Java
    Replies: 2
    Last Post: 10-17-2008, 06:50 PM
  4. Saving data in an XML file
    By Thez in forum New To Java
    Replies: 1
    Last Post: 12-08-2007, 09:24 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
  •