I have an XML file, and I have a batch file to search for a specific line in this file, replace it with a user-defined line, and then output it to a new XML file:
@echo off > entities_1.xml setLocal EnableDelayedExpansion if exist entities_1.xml del entities_1.xml set /p name= What is the new space NAME? for /f "tokens=* delims= " %%G in (entities.xml) do ( set str=%%G set str=!str:[Test Space]=[%name%]! echo !str! >> entities_1.xml )
This works, and all instances of [Test Space] are replaced with a user-defined value.
My problem, however, is that the batch file also deletes instances of exclamation points (!). So, for example, in XML there are lines similar to this:
<property name="title"><![CDATA[TEST2]]></property>
When the script package is launched, it replaces the above:
<property name="title"><[CDATA[TEST2]]></property>
those. separating !.
Where am I mistaken? Any ideas?
batch-file
JamesH Dec 02 '10 at 10:11 2010-12-02 10:11
source share