Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

writing to file - HELP!!!

 
Naf Rash
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic