File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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 The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript 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
Author

how to output to text file (help)

Rick Jones
Greenhorn

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?

Thanks!
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
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Use a java.io.FileWriter 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]
 
 
subject: how to output to text file (help)