Hello everyone,
i wonder if someone could give me an advice regarding the following problem using sed.
Given ist a structure as shown below:
<aaa>text1<b>text2</b>text3<c>text4</c>text5</aaa>
Now I want to change the outer tag from "aaa" to "new" and replace all tags inside the outer tags using underscores:
<new>text1_text2_text3_text4_text5</new>
The text has different length, the number and the names of the tags inside the outer tags differ.
Example:
<aaa>text1<b>text2</b>text3<c>text4</c>text5</aaa>
or
<aaa>text1111<bbb>text2122</bbb>texttttt3<cc>text4</cc>text5</aaa>
Is it possible to do this using sed?
Unfortunately I am new to sed and this is too diffucult for me...
Thx in advance and greetings from Germany
Marc