OK. I get the feeling you want me to write it for you. That's not going to happen, so if that's what you want, this conversation ends here. I'll help you write it, but that's all. It's not up to me to do your homework for you.
Let's start with something simple. Do you know how to create a function that will search inside a file for a string? This will involve opening a file and reading characters from it. Get that working, then move onto the next step.
Maybe I'm jumping to the wrong conclusion. A very common beginner mistake is to try to write the whole program at one go, much like you would write an essay, and simply be overawed by it. For some reason teachers don't tend to teach an incremental approach. Let me let you into a secret: most code is written incrementally: that is, we start with a "hello world" program, then add a small amount of functionality to it and make sure that works, befor adding another bit of functionality, and so on until the program is complete. So in this case your first bit of functionality might be to open the file, read the characters in it and display them to screen, or send them to another file. Having created the stream, you then add the code to locate the desired string within the stream, and maybe print something like "Got it!" on the screen. Then debug the string finding code. Finally modify the program to remove that string from the stream and it's done.