A string that is joined by chr$(13)+chr$(10) (CR LF) for PUTFILE will insert 2 lines, but chr$(9) (DEL) to remove won't so I'm wondering if it is possible.
To remove content from a file, read the file into memory, close and open in write mode and write back what you want in there. :-)
Try using OPENFILE/READLINE instead of the old GETFILE/PUTFILE functions wherever possible.