in reply to Script to update a value in text file

Can I get some help, how to go about in implementing this?
First, I'd learn a language of my choice. Then, in said language, I would:
  1. Get coffee (I recommend Java).
  2. Open the original file for reading.
  3. Open a new file for writing.
  4. Read in the original file, in chunks.
  5. For each chunk:
    1. Locate data I want to modify.
    2. Change the chunk so the value is incremented.
    3. Write the modified chunk to the new file.
  6. Close both open files.
  7. Move the new file over the original one.
  8. Finish coffee.
  9. Profit!
  • Comment on Re: Script to update a value in text file

Replies are listed 'Best First'.
Re^2: Script to update a value in text file
by apl (Monsignor) on Jun 15, 2010 at 10:36 UTC
    6a. Rename original file (so it's still around for post mortems)