File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes writing to file - HELP!!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "writing to file - HELP!!!" Watch "writing to file - HELP!!!" New topic

writing to file - HELP!!!

Naf Rash
Ranch Hand

Joined: Feb 19, 2004
Posts: 85
I am trying to write some results from my program to a file - I think this should be fairly straightforward especially since there is quite a lot of information to do that. My problem is with respect to the way I need the results to be written to the file. For instance, the results I want displaying are in an array - and for each line of the file I want all the rows for a particular column to be output in the following way:
{some numbers(ints) separated by a comma indicating the next element for that column(ie, the next row)}
I want this to be done for every column.
My problem is that I don't know how to do this - if it was a matter of taking some data from a textfield the matter would be fairly straight forward.
Does anyone have any suggestions???
Ernest Friedman-Hill
author and iconoclast

Joined: Jul 08, 2003
Posts: 24199

Well, you'd just use a couple of "for" loops, yes?

Be sure to use a BufferedWriter, or all these little writes will be slow.

[Jess in Action][AskingGoodQuestions]
I agree. Here's the link:
subject: writing to file - HELP!!!
It's not a secret anymore!