I’m working on an xml file, and ran into an issue I can’t solve.
I have a series of tags I’m working with, that currently look like this:
<spells>
<id-00001>
<actions>
<id-00001>
</id-00001>
</actions>
</id-00001>
<id-00002>
<actions>
<id-00001>
</id-00001>
</actions>
</id-00002>
<id-00003>
<actions>
<id-00001>
</id-00001>
</actions>
</id-00003>
<id-00001>
<actions>
<id-00001>
</id-00001>
</actions>
</id-00001>
</spells>
Due to certain reasons, the outer tags go from id-00001 to id-000XX before looping back to 1. The end number is not consistent, sometimes it goes up to 00009, sometimes to 00029.
There are 601 total pairs of parent tags (open and close), and I need to number them sequentially from 00001 to 00601
The internal labels need to be ignored, since they are needed. There’s usually 1 to 3 labels (00001 to 00003, or more if needed), but MUST be ignored.
I’m currently working on VSCode, but can adapt if needed.
I’ve tried selecting the tags with a regex, but this selects ALL tags, including children tags. Without this, any further testing is unnecessary, but I HAVE tried using Text Pastry in VSCode to autonumber and replace the tags.
Any ideas?
5
Came up with an answer, I’ll comment out the entire interior of the blocks by using multicursor selection in VSCode.
Crazy that people come up with rude and useless answers faster than I can come up with my own solutions.