File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "data save into txt file." Watch "data save into txt file." New topic

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:

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
Formula 1 app by Maxis (Playbook)
Huw Morgan

Joined: Mar 07, 2006
Posts: 23
A question I can answer. I have pincked the code from and hacked it a bit;

I agree. Here's the link:
subject: data save into txt file.
It's not a secret anymore!