Not a bad approach but reading character by character or writing character by character is slow when you want to make a Real-Life commercial application, I'd suggest you at least create a string of size 512 bytes (sometimes you would see them calling it a buffer), then fill that string with data until its full, manipulate it, empty it and repeat. If you're talking about the tion question, you could just create a new file, then when you're reading that original file, you can parse each word one after the other and write it to the newly created file, the newly created file is the file that we want, so after that, we Re-read it and copy everything to the old file, and finally, we delete it.
Also you're thinking creatively, you're using the newly learnt tools to better help you out, that's great but never forget that sometimes we care about Optimization, Time, Memory,..., we will take them later I think as a separate course.