Hi GregBrannon,
I think I have to rephrase my question to get the right help.
I want to do something with the first line in the text and only and only after that, can I start looping through the rest of the lines in the text.
so, I tried this:
line = br.readLine() //this is the first line..
//I do something with that line..
//now I want to skip to the next line..but don't know how to do it because when I run the next lines of code
//the nextLine is to read from the second line of the text NOT the first line anymore.. it is how to set the br to the nextLine, that I am trying to figure out..
while((nextLine =br.readLine())!=null){
//continue what I was doing..
}
Like I said, this can easily be done using apache.commons.io.FileUtils; as below:
LineIterator it = FileUtils.lineIterator(file, "UTF-8");
String line = it.nextLine(); //this goes to the next line..
but how to do the exact same thing with BufferedReader is my main question ?
--- Update ---
OK, I figured it out now. It seems, using BufferedReader doesn't have any method like nextLine(). one just has to do do what one has to do with the line and move to the while loop. This is for those who might come across this similar problem in the future.