Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading File into an array

 
Berty Ahern
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I want to load a persons details into an array from a text file so that I can then put that info into textfields, edit it and then some how save it into the file again. Can anyone supply me with some sample code of how i should do this?
Thanks in advance,
Berty
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would recommend starting with Sun's I/O streams tutorials. They're quite good and will give you a good understanding of the basics. Then make an attempt to write the code yourself (there's no better way to learn), and come back here to post specific questions and get help with non-working code.
 
Berty Ahern
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I have the I/O stream set up and its working with text fields its just that i can't figure out how to stick it into an array. I'll do more researcch...
TTFN
 
David Harkness
Ranch Hand
Posts: 1646
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you want to read the file's contents into a byte array? That wouldn't be very convenient for putting elsewhere. Can you explain exactly what you want to do? Be as specific as possible since the compiler will require you to be when coding.
 
Berty Ahern
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well I'm kinda getting the file like this:

The information would be in String type, would it be possible to get that into a byte array?
Cheers
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic