I have similar instructions like in the thread Print Matching line and nth line from the matched line
I would need to match the specific line, print it, then remove the following line (1st following line) and then print the rest until to match the specific line etc.
In other words, I need to remove only lines with </s>
which follows the line starting with <doc
.
My file:
<doc>
</s>
<s>
Bla
bla
bla
.
</s>
<s>
Bla
bla
bla
.
</s>
</doc>
<doc>
</s>
...
My required output:
<doc>
<s>
Bla
bla
bla
.
</s>
<s>
Bla
bla
bla
.
</s>
</doc>
<doc>
...