Win a copy of Securing DevOps this week in the Security forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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


 
Sheriff
Posts: 21256
87
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 .
 
I have always wanted to have a neighbor just like you - Fred Rogers. Tiny ad:
Thread Boost - a very different sort of advertising
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!