Parse XML file with windows batch

后端 未结 7 1347
感动是毒
感动是毒 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:20

    If you want to use a helper batch file (by aacini) then this will work:

    @echo off
    for /f "tokens=*" %%a in ('findrepl /i "<location>" /e:"</location>" /o:+1:-1 ^< "file.xml" ') do echo "%%a"
    

    This uses a helper batch file called findrepl.bat from - https://www.dropbox.com/s/rfdldmcb6vwi9xc/findrepl.bat

    Place findrepl.bat in the same folder as the batch file.

    0 讨论(0)
提交回复
热议问题