• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to Read a Flat File Data  RSS feed

 
khad M
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ranchers good Morning.
This is my fisrt Query in this forum.
I want to read a flat file data using JAVA.
How to do this.
I heard that StringTokeinger to be used.What exactly it is?
i.e How to read and Write on to flat file using JAVA I/O strems.
Thanks in advance.

Regards
Khad M
SCJP2.0
 
Roy Sin
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well, basically it depends what data does ur flat file consists of...
if it is just normal strings n endline char at the end...
ie. a
b
c

u could just use bufferedreader
if it is a whole string that is seperated by deliminators... and u wish to get each character out.. then u use stringtokenizer
ie a,b,c,d,e
bufferedreader code

stringtokenizer code

do a search on these topics.. there are lots of examples about bufferedreader and stringtokenizer.. also .. read up on the API Index..
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!