Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

reading content of files line by line

 
Nicky Eng
Ranch Hand
Posts: 378
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Joe Ess
Bartender
Posts: 9214
9
Linux Mac OS X Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Java Almanac: Reading Text From A File
 
Srinivas Kalvala
Ranch Hand
Posts: 257
Firefox Browser Hibernate Linux
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

String line;

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

Try more possible ways ....
 
Nicky Eng
Ranch Hand
Posts: 378
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks seniors.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic