Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

FileReader not reading blank lines at end of file

807569Aug 21 2006 — edited Aug 22 2006
I'm using a BufferedReader with a FileReader to read a file for further processing in my program. However it somehow refuses to read any blank lines at the end of the file.

The file consists of lines with various keywords and values, separated into block by blank lines. An emptyline at the end of the file is required to allow the program to recognize the end of the last block of data in the file.
(well, not by me.. it's a school assignment which requires me to read and use the final empty line, and generate and error message when a file has multiple blank lines. hence why i have to read in every line in the file, rather then solving the problem by simply adding a bit of code to add an extra blank line after reading in the file.)
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 19 2006
Added on Aug 21 2006
5 comments
1,469 views