• Post Reply Bookmark Topic Watch Topic
  • New Topic

Read a Flat File line by line and add it to a StringBuffer

 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

I am trying to read a Flat File which is line by line "\n" new line seperated .
I want to read each line and add it to a StringBuffer .

I tried this way ,but its not working .Please help


 
Rob Spoor
Sheriff
Posts: 20837
68
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You never change item. You read one line, then keep using the same line over and over.

You'll see that usually one of the following (nearly identical) loops is used:
 
Ravi Kiran Va
Ranch Hand
Posts: 2234
Eclipse IDE Firefox Browser Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you , Rob , you were always there to help .
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!