批量提取字符串之间的内容行
作者:互联网
@echo off & setlocal enabledelayedexpansion
set str1=“enbip”
set str2=“p”
set str3=“value”
echo %str1%,%str2%,%str3%>a.csv
for /f “delims=” %%i in (‘dir /b *.log’) do (
for /f “usebackq delims=” %%b in ("%%~i") do (
set “s=%%b”
if not “!s:OptionalFeatureLicenseId=!” == “!s!” set “flag=1”
if not “!s:userLabel=!” == “!s!” (set flag=) else if defined flag for /f “tokens=1,2 delims= " %%o in (”%%!s!") do echo %%i,%%o,%%p>>a.csv
) )
pause
标签:do,set,提取,批量,%%,delims,echo,flag,字符串 来源: https://blog.csdn.net/qq_44390640/article/details/100105606