This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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]
 
I agree. Here's the link: http://aspose.com/file-tools
 
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