File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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 Soft Skills this week in the Jobs Discussion 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: 8996
    
    9

Java Almanac: Reading Text From A File


[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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: reading content of files line by line