hi all, i have a program that read log file that generated by other service (apache http server for example), i want to know that each line is ending with "\r", "\n" or "\r\n" so i can skip them in the next time, like this:
int char_counter=0;
BufferedReader reader = new BufferedReader(new FileReader(logFileName));
while((line=reader.readLine())!=null){
char_counter+=line.length()+x_value;
}
and the next time read the log file, i will skip all the lines that read in previous time.
BufferedReader reader = new BufferedReader(new FileReader(logFileName));
reader.skip(char_counter);
while((line=reader.readLine())!=null){
char_counter+=line.length()+x_value;
}
with x_value is 1 or 2 depended on line end with "\n" or "\r\n".
so, how to know which is the char line ending with?
Edited by: secmask on Feb 21, 2009 5:46 AM