> But the program stops in the first null line.
null != empty_line
A null returned signifies that a end of file has been reached and has got nothing to do with empty lines. Inside your loop, just check to see if str.trim().length() != 0 and write that line to the target file.
Super Moderator
Featured Poster
Reputation Points: 3241
Solved Threads: 719
Failure as a human
Offline 8,873 posts
since Jun 2006