This week's book giveaway is in the Kotlin forum.
We're giving away four copies of Kotlin in Action and have Dmitry Jemerov & Svetlana Isakova on-line!
See this thread for details.
Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading Char into string  RSS feed

 
Ian Cockcroft
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone.
I am reading a flat file in this format
KID|AG01|Anteneh|Gebreal|OG|19961128|Pig|A*
KID|AC02|Aurakeasamy|Carmine|OG|19960519|Square|A*
KID|BA03|Beukman|Ashley|OG|19960711|Star|A*
KID|BE04|Bihl|Elrique|OG|19951229|Teapot|A*
KID|CH05|Chauhan|Harsheel|OG|19960812|Robot|A*
KID|CD06|Chipaka|Danteek|OG|19960514|Seal|A*
KID|DS07|Davies|Sandile|OG|19960828|Triangle|A*
KID|DS08|de Assuncao|Sergia|MG|19970206|Iron|A*
unfortunately I can only get it back in char format, how can i get a string for each line, iterating? I can then us a stringtokenizer to break it up for my database.
some code would be most helpful
Thanks,
regards
Ian
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The BufferedReader class has a readLine() method.
 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A nice feature of these forums is the ability to search past conversations for information. The search page link is at the top right of this page.
This past conversation on using the BufferedReader class hopefully will provide you with enough information to get you started.
Good Luck.
 
Ian Cockcroft
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Dirk, I'll go stand in corner now.lol
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!