File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes how to output to text file (help) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to output to text file (help)" Watch "how to output to text file (help)" New topic

how to output to text file (help)

Rick Jones

Joined: Jul 06, 2005
Posts: 6
I've created a list of files froma directory. How can I get that to out put to a text file?

Steve Morrow
Ranch Hand

Joined: May 22, 2003
Posts: 657

The Java� Tutorial - I/O: Reading and Writing (but no 'rithmetic)
The Java Developers Almanac 1.4: e37. Writing to a File
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Use a to open a file. Wrap the FileWriter in a PrintWriter. Then print each name to the file. Then close the file.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: how to output to text file (help)
It's not a secret anymore!