I'm trying to update a series of xml files by changing names that they reference. I have a table of names that have changed, column for the current name and a column for the name to replace with.
I looked for ways to script search and replace and found sed. It seemed like a good choice until I ran my first attempt. On inspecting the file, I found several unrecognized characters between every carriage return and line feed. I did some searching and found that there are issues with sed used on utf-16 files.
These are text files that I'm searching, though there are copies stored in a SQL Server table in a column with type xml. When updating or populating the database, the fields are always set like ColumnName=N'xmltext'.
I'm interested in how I could update those fields also, though the main question is how best to update the text files.
I'm using extended regular expressions, my search is for ([>\.])OldName([<\.]) and I replace it with \1NewName\2