File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes I/O and Streams and the fly likes data save into txt file. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "data save into txt file." Watch "data save into txt file." New topic
Author

data save into txt file.

Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
i have some input from user, and will save into a text file.

Title : "will go for cousin wedding"
Date : "9/9/06"
Note : "borrow car from uncle"

all string data from user.
which class i should use? FileOutputStream, BufferedOutputStream, StringWriter etc....

and i want every record in text file in new line , such as:

abc.txt
-----------------------------------------------------------
will go for cousin wedding, 9/9/06, borrow car from uncle // a record
here is another record of inputs. // another record

-----------------------------------------------------------

how to do that?


From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Huw Morgan
Greenhorn

Joined: Mar 07, 2006
Posts: 23
A question I can answer. I have pincked the code from http://www.javacoffeebreak.com/java103/java103.html and hacked it a bit;

 
 
subject: data save into txt file.
 
Similar Threads
saving data in JavaScript
read text file and save data into database
Exception in thread "main" java.lang.NullPointerException error
would you walk from Georgia to Maine?
Who can help me?