Parse XML file with windows batch

后端 未结 7 1373
感动是毒
感动是毒 2020-12-01 21:26

How can I extract an STRING like \"US_NY\" between the tags from a XML file? I tried it with FINDSTR, but the line breaks are

7条回答
  •  感情败类
    2020-12-01 22:10

    You should use XML.EXE within batch to read an XML file. For more details go to http://xmlstar.sourceforge.net/

    Batch File:

    @echo off
    for /f %%i in ('XML.EXE sel -t -v "//LOCATION" CP.xml') do set var=%%i
    echo LOCATION is %var%
    

    output:

    LOCATION is US_NY
    

提交回复
热议问题