G
gk
i use the code below to read a text file.
try {
BufferedReader in = new BufferedReader(new
FileReader("infilename"));
String str;
while ((str = in.readLine()) != null) {
process(str);
}
in.close();
} catch (IOException e) {
}
but when the file has a NEWLINE at the END ....the code also read that.
i just dont want to read that NEWLINE as soon as i come to the end.
what i have to do ?
try {
BufferedReader in = new BufferedReader(new
FileReader("infilename"));
String str;
while ((str = in.readLine()) != null) {
process(str);
}
in.close();
} catch (IOException e) {
}
but when the file has a NEWLINE at the END ....the code also read that.
i just dont want to read that NEWLINE as soon as i come to the end.
what i have to do ?