wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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]
 
jQuery in Action, 2nd edition
 
subject: how to output to text file (help)
 
Similar Threads
how to print the text in text area
java IO
string input for txt file..
read a text file
unicode