I have an XML file with several elements, and each child of item
appears twice. The file looks something like this:
<item>
<array name="time_entries">
<item>0</item>
<item>10</item>
</array>
<array name="time_entries">
<item>0</item>
<item>10</item>
</array>
<array name="game_level">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</array>
<array name="game_level">
<item>0</item>
<item>1</item>
<item>2</item>
<item>3</item>
</array>
</item>
I want to remove the duplicate elements with attribute name
from the root.
I tried VS Code find and replace using Regex options. I entered (<item name=".*">#...</item>)(s*2)
in the find field and $1
in the replace field.