I am in a very critical problem,

I read some text from a file and made some operations on it and stored it to another file. This time i want to make operations on the text in new file and this step has to be repeated for a particular number of times. Each time the text in the new file has to be updated according to the operation and it will be input for next operation. So please can anybody give me some idea

Thanks in advance.