aspose file tools*
The moose likes I/O and Streams and the fly likes Read a Flat File line by line and add it to a StringBuffer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Read a Flat File line by line and add it to a StringBuffer" Watch "Read a Flat File line by line and add it to a StringBuffer" New topic
Author

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

Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

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




Save India From Corruption - Anna Hazare.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19761
    
  20

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:


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ravi Kiran Va
Ranch Hand

Joined: Apr 18, 2009
Posts: 2234

Thank you , Rob , you were always there to help .
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Read a Flat File line by line and add it to a StringBuffer