in reply to Re: output can be displayed in screen, but not in output file
in thread output can be displayed in screen, but not in output file

Thank you very much! It works perfectly. I will keep learning from here!
  • Comment on Re^2: output can be displayed in screen, but not in output file

Replies are listed 'Best First'.
Re^3: output can be displayed in screen, but not in output file
by tachyon-II (Chaplain) on Nov 29, 2007 at 02:29 UTC

    To prevent unwanted disaster I suggest the first step should be to rename the file file.txt -> file.txt.bak. Then read this .bak file and write out the new file, that way you retain the original in case you accidentally destroy the data, which is easy enough to do.