I need to fix an error and to replace the second tag </time>
with </tags>
in an XML file with the following structure:
<time>20260664</time>
<tags>substancesummit ss</time>
<geo>asdsadsa</geo>
<time>20260664</time>
<tags>substancesummit ss</time>
<geo>asdsadsa</geo>
I'm trying to do it using sed and since I have 2 </time>
closing tag per item, my idea is to replace </time><geo>
with </tags><geo>
.
However there is a next line symbol in between, so I'm using \n
but it doesn't work:
sed 's/time>\n<geo>/tags>\n<geo>/g' old.xml > new.xml
Any help?