How to go to a specific line # in java?
807607Nov 15 2006 — edited Nov 16 2006Hi,
I have located a keyword in a file using the bufferredreader class (by reading line by line and searching for the keyword).
This method returns the # of the line that contains the keyword. Say this method return 'n'. I need to pass this information to another method and have it skip the first 'n' lines and start reading from the (n+1)th line.
I have not found this capability in the Bufferredreader class nor other classes in Java that I looked at. Do you know of any filereader class that does that?
Note that my intent is to delete the line that contains this keyword. The way I am thinking of right now is to find the line, pass its line # to another method and have that method line (n)th with (n+1)th sequentially to the end of the file. Would you suggest a better way of approaching the problem all together?
Thanks,
parachuter2b