0

I'm trying to get a value from a property file and use the value in a xml file. I'm able get the value from property file with the below code.

@echo off  
FOR /F "tokens=1,2 delims==" %%G IN (demo.properties) DO (set %%G=%%H)  
echo %filepath%

Can you let me know if it is possible to update the file path in the XML using batch if it is in the below format?

<Filesystem area="D:/oldpath"/>

<Filesystem area="C:/newpath"/>
user2628187
  • 313
  • 6
  • 18
  • I swear this type of question is the second most commonly-asked question on the [batch-file] tag, right behind "Why isn't this variable updating?" – SomethingDark Aug 25 '16 at 00:07
  • I dont want to seatrch for the value inside the tag. Instead I want to search for the tag and replace whatever is inside it to new text – user2628187 Aug 25 '16 at 09:14
  • The batch file replacement is simple only if the tag and the value are on the same line. So I suggest using powershell or call [JREPL.BAT](http://www.dostips.com/forum/viewtopic.php?t=6044): `call jrepl "()(.*?)()" "$1newvalue$3" target.xml` – wOxxOm Aug 25 '16 at 12:34

0 Answers0