Reading a file. Is it possible to choose the line to start from?
Rudolph Ten
Greenhorn
Joined: Jan 23, 2002
Posts: 9
posted
0
Is it possible to choose the line I want to start reading the file from? I am new to java.
I was using this code: ========================= while((s = br.readLine()) != null) { System.out.println(s); totalLineReadInCnt++; ========================= Thanks in advance Rudy
Manfred Leonhardt
Ranch Hand
Joined: Jan 09, 2001
Posts: 1492
posted
0
Hi Rudolph, The only I/O class that lets you start reading a file anywhere is the RandomAccessFile class. It provides a readLine method so you should be able to use it to start reading anywhere. I don't think you can tell it to skip so many lines though because the skipping only works with bytes. Regards, Manfred.