Results 1 to 3 of 3
  1. #1
    ddatta8 is offline Member
    Join Date
    Dec 2008
    Posts
    27
    Rep Power
    0

    Default append variables to a text file

    Hi,

    I have a text file having the following format:
    def234 bobby
    abc123 jumbo
    cde234 katie

    I want to append to this text file the data contained by two variables studID and password. How do I do that?
    I have tried using

    Any help would be appreciated.
    Thanks.
    Last edited by ddatta8; 01-02-2009 at 05:41 AM. Reason: wrong info

  2. #2
    mtyoung is offline Senior Member
    Join Date
    Dec 2008
    Location
    Hong Kong
    Posts
    473
    Rep Power
    6

    Default

    use fileWriter (with append property)
    with BufferedWriter
    use append method to append info
    finally call flush method

    remember to close writer steam

  3. #3
    ddatta8 is offline Member
    Join Date
    Dec 2008
    Posts
    27
    Rep Power
    0

Similar Threads

  1. java DOM: append text to node
    By newbieal in forum New To Java
    Replies: 2
    Last Post: 10-10-2008, 08:18 PM
  2. find and replace text from a text file
    By gezzel in forum New To Java
    Replies: 2
    Last Post: 09-19-2008, 05:04 PM
  3. Replies: 4
    Last Post: 07-05-2008, 06:47 AM
  4. Replies: 1
    Last Post: 08-07-2007, 06:35 AM

Posting Permissions

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