I have an XML file containing, amongst other lines, <asd>blablabla</asd>
and
<dsa>-some stuff
-other stuff
final stuff.</dsa>
I want to replace everything between the "asd" tags with whatever is between the "dsa" tags, which will almost 100% be multiline. I do not want to replace the tags, themselves, only the text between them and keep the newlines.
The file will change from time to time, it's name, extension and tags will remain the same, only the content between them will change.
I need a command that can achieve this on a basic, bare bash, the kind Github Actions use.
I was thinking of sed
, however I don't know how to tell it to replace with multiline.
EDIT:
My mistake (maybe?) my file is actually a .net csproj file, not a true XML file, so I'm unsure if commands like xmlstarlet
would work with it.