Parse XML file with windows batch

后端 未结 7 1357
感动是毒
感动是毒 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条回答
  •  Happy的楠姐
    2020-12-01 22:16

    Pure batch -

    @ECHO OFF
    SETLOCAL
    SET "location="&SET "grab="
    FOR /f "tokens=*" %%a IN (q19722041.xml) DO (
     IF DEFINED grab SET location=%%a&SET "grab="
      IF /i "%%a"=="" SET grab=Y
    )
    ECHO found location=%location%
    GOTO :EOF
    

    where q19722041.xml is your source .xml file.

提交回复
热议问题