I have a large XML file that I now want to parse. The XML is fundamentally broken, and with over 2000 lines, I’m trying to avoid a hand cranked fix 😉
Can I use regex replace in Notepad++ to do this?
<Sensor ID="21.1.1_L"/>
to
<Sensor ID="21.1.1_L">
losing the tag close slash in all “Sensor” tags (and bearing in mind that I cannot simply replace /> with > and the ID is variable, including it’s length and may or may not have the trailing underscore and alpha).
Thanks for any suggestions.
This should work: Search for
and replace all with
[^<>]*will match any number of characters except angle brackets (this is to make sure that we can never match across a tag’s boundary). Then,/>matches only if the current tag ends with a slash.You will need to turn on regex matching in Notepad++, of course.