I have an XML file like this:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<configuration>
<messaging msg="otherfiles.xml" />
<counter tes="01" />
<gate address="192.168.1.1:12345" allowed="172.11.1.1"/>
</configuration>
The file name is test.xml test.xml
.
And I have an bat file:
@echo OFF
set dir="D:\Test"
for /f "delims=" %%i in ('findstr /i /c:"address" %dir%\test.xml') do call :job "%%i"
goto :eof
:job
set line=%1
set line=%line:/=%
set line=%line:<=+%
set line=%line:>=+%
set line=%line:*+string+=%
set line=%line:+=&rem.%
echo.%line%>>%dir%\output.txt
:eof
I need output like this:
192.168.1.1:12345
Can anyone help me?