I've got an XML file I need to append to after a specific set of tags. Basically the file structure looks like this:
<key>servers</key> <dict> ... Server Details ... </dict>
I would like to match on the lines:
and append a block of XML specifying a server connection immediately after
<dict>. I've got the new XML block in its own text file as it's quite long.
I've looked at
awk to do this but I've come up against a wall. I've also seen examples of using
perl to accomplish this but I'm not so familiar with Perl. From what I understand though,
awk aren't great at multiline matching.
The reason I need to do multiline matching is because the
<dict> tag is used frequently within the XML file and I need to append a block into the
<key>servers</key> section, as opposed to replacing its entire contents.