Extracting text from XML file via batch file
I have to extract certain text from an XML file via a batch file. One of the parts I need to extract is between string tags ( <string>example1</string> ) and the other is between data tags ( <data>example2</data> ). Any ideas how? Thanks in advance! @echo OFF del output.txt for /f "delims=" %%i in ('findstr /i /c:"<string>" xml_file.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%>>output.txt :eof Output with OP's input file- D:\>draft.bat D:\>type output.txt 000000000