I have an xml file that is stripped down to output that looks bacically like;
<!-- TABLEA header -->
<tablea>
some fields
</tablea>
<!-- TABLEB header -->
<!-- TABLEC header -->
<tablec>
some fields
</tablec>
I want to remove the header where it contains no tag or field info (TABLEB) so output should look like;
<!-- TABLEA header -->
<tablea>
some fields
</tablea>
<!-- TABLEC header -->
<tablec>
some fields
</tablec>
In some cases files will have TABLEB info so only want to delete if no info is contained and the next line is another header comment. Any suggestions using a sed script or similar?