in reply to HELP!! urgent!writing contents toa specific line in an existing file
Basically, friend, you're dealing with several problems at once... and you need to sort them out. Let's try to do that...
First of all, whenever a computer-program needs to regard a file as is input, it probably needs to first open that file for input, and read that file completely, before it opens the same file for output ... because, generally speaking, "opening a file for output" erases it.
(Opening a file for "read/write" will not erase it.)
Let us assume for the sake of argument what is usually the case: that the input file and the output file for a particular program are separate and distinct files. If this be the case, then our problem is simplified: we merely need to recognize "blank lines" and substitute them with "whatever..."