本帖最后由 ppll2030 于 2024-3-27 22:30 编辑
只处理同级目录下的xml文件- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%f in ('dir /b /a-d "*.xml"') do (
- for /f tokens^=1^-5^delims^=^<^=^" %%1 in ('findstr /ic:"item" /ic:"count=" "%%f"') do (
- if "%%2" == "item>" set "v="
- if "%%2" == "ingredient count" set "v=!v!, %%5, %%3"
- if "%%2" == "production count" echo, !v:~1!, %%5, %%3
- )
- )>>res.csv
复制代码
|