I have a very large ASCII text file. It's an Apache webserver log. It contains 4,783,012 lines and is 1.66GB. I need to look at each line of the file independently. This makes using "java.nio" a bit more difficult because I'll have to parse out a line from a buffer by looping through the buffer looking for '\r' or '\n' to determine a line in the log.
Of course, I could do the standard...
However, this takes 30 - 40 seconds just to do a line count. Is there a more efficient method I should look at to doing this?
Thanks!
Of course, I could do the standard...
Code:
FileReader fr = new FileReader("C:\access.log");
BufferedReader br = new BufferedReader(fr);
String strLine;
while ((strLine = br.readLine()) != null) {
//PARSE LINE...
}
However, this takes 30 - 40 seconds just to do a line count. Is there a more efficient method I should look at to doing this?
Thanks!