Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-02-2009, 04:41 AM
Member
 
Join Date: Dec 2008
Posts: 16
Rep Power: 0
ddatta8 is on a distinguished road
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 04:41 AM. Reason: wrong info
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 01-02-2009, 05:36 AM
Senior Member
 
Join Date: Dec 2008
Location: Hong Kong
Posts: 393
Rep Power: 1
mtyoung is on a distinguished road
Default
use fileWriter (with append property)
with BufferedWriter
use append method to append info
finally call flush method

remember to close writer steam
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.
Bookmark Post in Technorati
Reply With Quote
  #3 (permalink)  
Old 01-02-2009, 10:17 AM
Member
 
Join Date: Dec 2008
Posts: 16
Rep Power: 0
ddatta8 is on a distinguished road
Default
Thanks very much. I will try it.
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
java DOM: append text to node newbieal New To Java 2 10-10-2008 07:18 PM
find and replace text from a text file gezzel New To Java 2 09-19-2008 04:04 PM
variables in hibernate.cfg.xml file bbq Database 4 07-05-2008 05:47 AM
Append text inputed in the textfield into a TextArea romina AWT / Swing 1 08-07-2007 05:35 AM


All times are GMT +2. The time now is 03:11 AM.



VBulletin, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org