I'm trying to insert a string into multiple lines using sed, but i don't get the desired result
I have this:
<p begin="540960420t" end="600189590t" xml:id="subtitle8">-Some text.<br/>-Some more text</p>
<p begin="601020420t" end="653572920t" xml:id="subtitle9">-Something else<br/>Some more text</p>
<p begin="654403750t" end="731560830t" xml:id="subtitle10">More words<br/>-more text</p>
<p begin="732401670t" end="786625840t" xml:id="subtitle11">Some text.<br/>Some more text</p>
and I need to insert this
<span style="style0">
Before the "subtitle[0-200]"> so it will be like this:
<p begin="540960420t" end="600189590t" xml:id="subtitle8"><span style="style0">-Some text.<br/>-Some more text</p>
<p begin="601020420t" end="653572920t" xml:id="subtitle9"><span style="style0">-Some text.<br/>Some more text</p>
etc...
I was trying something like this:
cat demo.xml | sed 's/xml:id="subtitle[0-9]">/<span style="style0"><p/g'
But this replaces the xml:id="subtitle[0-9]"> and only from subtitle0 to subtile9
I am quite new to all this sed and regexp thing, if something else should be easier than sed then it's fine ..
Best Regards Soren