bat文件逐行读取txt
From_Ip='192.138.60.16'
@echo off
for /f "tokens=1,2 delims='" %%a in (D:\ETL\bat\config.txt) do (
if "%%a"=="From_Ip=" set From_Ip=%%b
)
echo %From_Ip% 结果:192.138.60.16
From_Ip=192.138.60.16
@echo off
for /f "tokens=1,2 delims==" %%a in (D:\ETL\bat\config.txt) do (
if "%%a"=="From_Ip" set From_Ip=%%b
)
echo %From_Ip% 结果:192.138.60.16