I'm looking for a program that can batch edit xml files.
Because of a change in the software we're developing we have to do a rework on our testdata (xml).
It's very time consuming to this by hand; nearly a thousand files, so automating this process would come in quite handy.
It's always the same data that needs to be edited in the xml files. But only if the field is empty.
e.g. the name field needs to be filled with "testname" but in one xml file the name field is filled "<name> George </name>" . it's not empty so the name remains the samen (George).
Hi, Thanks for the advice. I looked into both programs "WinGrep" and "SmartReplace".
They are good at batch processing. The find functionality of the program however is too heavy.
I need something that can distinguish between if a </name> tag is empty or not. There are also more than one </name> tags in one document, and only one specific </name> tag needs to be replaced.
Hmmm, sounds like you need an XML editor then. Since you will need the context of knowing which version of <name> to fill, a simple line replace will not do.
An option you might also want to consider writing a custom tool for your custom needs. You know, like finding the first <Name> that comes after <title>Owner</title>, (pretending that this is the name in need of filling) and only checking that one.
Another option is loading the XML into a spreadsheet, where the items are based on a column position. Then, go down the column to update the empty 'owners', and save back to XML.
Finally, consider using the find tool to show you all the empty names, so that at least you will have a definitive list for manual replacing by an intern.
Sorry that this is not as easy a solution as you would have hoped...
Software Test Engineer
If builders built buildings the way programmers wrote programs, then the first woodpecker that came along would destroy civilization.