I have hundreds of .xml files in a single directory, and I want to automatically add the same three lines of code to every file.
In each file, after the first instance of this line:
</staff-details>
I want to add these lines:
<transpose>
<chromatic>-2</chromatic>
</transpose>
The string </staff-details>
appears multiple times in each file, but I only want to insert the three lines after the first time the string appears.
Please could someone tell me how to do this with a Windows utility (command-line is fine)?
I've found various similar questions here, but I haven't managed to make any of the answers work for this situation (which is no doubt because I am a novice at this kind of thing).
Thanks!