Reputation: 1
This is not really a programming question, I just have an XML file like this:
<product>
<id>123</id>
</product>
<product>
<id>245</id>
</product>
<product>
<id>356</id>
</product>
I want to find all id's and replace them with just one "0". As ID's are different, I cannot use notepad++ because it can't find like <id>*</id>
so how can I do it? The file is really long.
Upvotes: 0
Views: 861
Reputation: 101
Note: Answering as per the XML structure given.
Use Notepad++ Regular expression and replace \d+ with 0.
Upvotes: 1
Reputation: 12375
You can replace the tag content even in Notepad++ with a Regex-based find&replace:
Search:
<id>[^<>]+</id>
and replace it with:
<id>0</id>
This should be the find and replace window (remember to enable "Regular Expression"):
XML before replacing:
XML after replacing:
Upvotes: 0