I have a file. I have to search whether the last line is empty(blank line) or not. if it is a blank line, I have to delete it. I dont want to move it to a temp file and again to original file after deleting the last line because I am doing some more modification in that file. Just I want to check whether the last line is blank or not and delete it if it is blank. Pls help.
This will remove the last line of file only if that line is blank. It will directly edit the file without having to make a temp copy of the file.
Hope this helps