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

posted @ 2017-09-22 16:01  小银光  阅读(19484)  评论(0编辑  收藏  举报