Find/Replace in Files for Multiple Lines in an XML file
Posted: Wed May 04, 2022 3:46 am
Hi all,
I am working on a metadata clean up project. I need to make the same specific changes to dozens and sometimes hundreds of record in batches. I am having issues using the Find/Replace in files function when I have to make changes to the structure of the metadata. The single file find/replace works well in that I can locate an entire structured metadata element and modify or delete. When I use the Fine/Replace in files function, it will only let me find and replace the first line of text from the XML document.
I want to delete the data in the element where null is the value. In the example below I want to remove all of the following lines from a dozen records:
But when I do Search/Replace in flies, the Text to find text box will only let me include the first line <mods:name type="corporate" authority="local"> as the text to search for,
I cannot seem to figure out how to searching across multiple lines across multiple files. Any help would be appreciated.
Thanks,
Mike
I am working on a metadata clean up project. I need to make the same specific changes to dozens and sometimes hundreds of record in batches. I am having issues using the Find/Replace in files function when I have to make changes to the structure of the metadata. The single file find/replace works well in that I can locate an entire structured metadata element and modify or delete. When I use the Fine/Replace in files function, it will only let me find and replace the first line of text from the XML document.
I want to delete the data in the element where null is the value. In the example below I want to remove all of the following lines from a dozen records:
Code: Select all
<mods:name type="corporate" authority="local">
<mods:namePart>null</mods:namePart>
<mods:role>
<mods:roleTerm type="text" authority="marcrelator">null</mods:roleTerm>
</mods:role>
</mods:name>
I cannot seem to figure out how to searching across multiple lines across multiple files. Any help would be appreciated.
Thanks,
Mike