in reply to open file for read/write
Take a look at Modify file without any temp variable
Thanks Gopal.R