• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reading the previous lines in a file

 
SriJyothsna Yeleswarapu
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 9266
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the JavaRanch, SriJyothsna.
Have a look at java.io.PushbackReader or java.io.RandomAccessFile and see if they will meet your requirements.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic