aspose file tools*
The moose likes I/O and Streams and the fly likes reading content of files line by line Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "reading content of files line by line" Watch "reading content of files line by line" New topic
Author

reading content of files line by line

Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
I have a txt file like this

Meeting with friens in starbucks , 9/9/06 , meeting derek and shane
Go to Thailand , 9/12/06 , go for checking farms there
Conference in Malaysia , 9/17/06 , visit Genting Highlands as well




And i use BufferedReader.
but i want to read line by line in the stream, so i use readLine() first, after that , i dont know how to read the next line in the stream b4 it close().



Anyone have idea?


From NickyEng
Diploma in Computer Studies
SCJP 1.4
SCWCD 1.4
Formula 1 app by Maxis (Playbook)
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8873
    
    8

Java Almanac: Reading Text From A File


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Srinivas Kalvala
Ranch Hand

Joined: Oct 20, 2005
Posts: 257

Hello,

String line;

while((line=BufferReader.readLine())!=null)
System.out.println(line);

Try more possible ways ....
Nicky Eng
Ranch Hand

Joined: Mar 26, 2005
Posts: 378
thanks seniors.
 
 
subject: reading content of files line by line