You're going to have to read and re-write all the file starting at the "abc" line and moving everything down by the length of the line. Not a pretty process. If the file's small enough to fit into memory you can simplify the code by reading it all into an array, deleting the abc line from the array, then re-writing the whole file from the array.
Think of a file as a long strip of paper with designs on it. If you want to remove a design, you have to make a cut in the paper just after the design and drag the end piece over the design you want to remove.