in reply to Update Multiple Files

This question seems very similar to your last one, Delete Lines Across Multiple Files, and in fact the same advice (looping over the files instead of copy&pasting code) applies.

Replies are listed 'Best First'.
Re^2: Update Multiple Files
by PilotinControl (Pilgrim) on Jan 05, 2021 at 15:44 UTC

    @Haukex: you are correct. Adding/Deleting works perfectly.....updating works fine with 2 out of the 3 files.....the only difference is 2 files are in one directory and 1 is in another. I also gave permissions to FULL CONTROL on the sub directories eliminating any security issues. That did not make a difference.

      So, did you remove operations on the first two files and attempt the modifications on the third one by itself, to rule out that it's not the addition of the third file that breaks things, but it's ONLY the third file that's broken?

      Do so. This is called "halving the problem". If it's only the 3rd file that's borked, you can focus on it alone.

      Also, that's a lot of unneeded repetition, which is always prone to mistakes. Use a loop as suggested.