How To Delete A Specific Record From A Text File

Does anyone know how to delete a record after searching it from a text file.
Searched most of places on the wen. Even in this forum but still i can't understand it.
There's no way to delete a line from a text file, you'll have to open the file and write everything but the line in question to another file.
How to do that?
Topic archived. No new replies allowed.