Possible to do this in RegEx with Notepad++



I have a large set of xml data with errors in certain parts of the file. The error is basically that there are lines where there is an but not a start to it. I need to find all instances of without the start tag and remove them.


So the correct XML data:



<Car Name="HONA">
<Group GID="3">
<Pmeter ParName="*CDMZI" Value="F%+A8E=,,,0;+MS=V123,456;" Type="A" Flag="P" />
<Pmeter ParName="DMTZ" Value="" Type="A" Flag="P" />
<Pmeter ParName="CDRFCP" Value="0" Type="A" Flag="P" />
</Group>
<Group GID="15">
<Pmeter ParName="#PT" Value="NONE" Type="A" Flag="P" />
<Pmeter ParName="CDH6" Value="100.111.100.44" Type="A" Flag="P" />
<Pmeter ParName="CDEPORT" Value="9003" Type="A" Flag="P" />
</Group>


The incorrect version I need to fix. Note that the has no start. I want to remove any without a start tag.:



<Car Name="HONA">
<Pmeter ParName="*CDMZI" Value="F%+A8E=,,,0;+MS=V123,456;" Type="A" Flag="P" />
<Pmeter ParName="DMTZ" Value="" Type="A" Flag="P" />
<Pmeter ParName="CDRFCP" Value="0" Type="A" Flag="P" />
</Group>
<Group GID="15">
<Pmeter ParName="#PT" Value="NONE" Type="A" Flag="P" />
<Pmeter ParName="CDH6" Value="100.111.100.44" Type="A" Flag="P" />
<Pmeter ParName="CDEPORT" Value="9003" Type="A" Flag="P" />
</Group>

No comments:

Post a Comment