File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

File Reader

 
Raghavendra U Ganiga
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

i want know how to read a particular line in a text file using JSP's file reader option.

Raghav
:roll:
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
 
Raghavendra U Ganiga
Greenhorn
Posts: 5
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
it may be any type of file reader or buffer reader option which is suitable.

Regards
Raghav
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64185
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
JSP has no special facilities for reading files once you have determined their path. So I've moved this to the I/O forum.
 
Ernest Friedman-Hill
author and iconoclast
Marshal
Pie
Posts: 24204
34
Chrome Eclipse IDE Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Assuming lines of unequal length, the only way to read a particular line in a file in Java is to read all the data before the line, then read the line. For example,



I've skipped error handling entirely here -- you want to check readLine() for a null return whenever you call it, because it means you've hit end-of-file.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic