wood burning stoves 2.0*
The moose likes I/O and Streams and the fly likes Reading the previous lines in a file 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 the previous lines in a file " Watch "Reading the previous lines in a file " New topic
Author

Reading the previous lines in a file

SriJyothsna Yeleswarapu
Greenhorn

Joined: Jan 16, 2006
Posts: 1
Is there some way to skip to the previous lines in a file, besides customizing the readLine() method for it?
I intend to skip to previous lines in a text file after having reached a position by a binary search on some element in it.
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8876
    
    8

Welcome to the JavaRanch, SriJyothsna.
Have a look at java.io.PushbackReader or java.io.RandomAccessFile and see if they will meet your requirements.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reading the previous lines in a file