What could be the possible reasons for below code always returning null.
The path mentioned as file name is correct and the file is present at this path.
Can you please try with some other file and see if the issue persists. There might be issue with the file itself. As long as \n , \r are encountered, readLine() will consider this as a line and give you a string represention of that line.
Piyush Mangal wrote:Can you please try with some other file and see if the issue persists. There might be issue with the file itself. As long as \n , \r are encountered, readLine() will consider this as a line and give you a string represention of that line.
Even if there are not EOL characters, readLine will just read the entire file as one line.
Are you trying to read the same file with the same FileInputStream : fin before you are reading in
while((upldRec = bufin.readLine()) != null)
{
// control does not reach here.
}
What could be the possible reasons for below code always returning null.
The path mentioned as file name is correct and the file is present at this path.
Thanks
Hi
I try to run the code you posted, it works fine and able to read the text file. The path i gave is forward slash and not backword slash. back slash is for escaping. If you found solution already let me/us know thankyou.