You should read the file line by line (you may use
getline[
^] for the purpose), and save read lines to a memory buffer, for instance a vector of string (or to another, temporary, file),
skipping the '
to be deleted' line. Finally overwrite the existing file with the memory buffer content (or with the temporary file content).