-2

I am trying to implement a simple log reader and for that I looking for a java framework (e.g. apache commons io) which does the following -

  • reads a text file line by line
  • provides a paging functionality - i.e. I should be able to mention the number of lines I need to read from file + get the lines from the next page start - say 50th line to 100 th line

Is there any standard framework which does this ? (dont want to reinvent the wheel here)

D Concept
  • 1
  • 1

1 Answers1

0

Enough to help you get started!

Scanner scanner = new Scanner(new FileReader("myFile.txt");

while(scanner.hasNext()) {
    String line = scanner.next();
    System.out.println(line);
}
Chad
  • 872
  • 8
  • 24