本帖最后由 CrLf 于 2016-4-7 01:42 编辑
暴力解1:- @echo off
- for /f "delims==" %%a in ('set') do set "%%a="
-
- set CurrentGroup=AAAA
- set CurrentServer=BBBB
- set CurrentLine=CCCC
-
- (for /f "delims=" %%a in (a.txt) do (
- for /f "delims==" %%b in ("%%a") do (
- if defined #%%b (set %%b) else echo %%a
- )
- ))>b.txt
- pause
复制代码 暴力解2:- @echo off
-
- (for /f "tokens=1* delims==" %%a in (a.txt) do (
- set "name=%%b"
- set "%%a=%%b"
-
- set CurrentGroup=AAAA
- set CurrentServer=BBBB
- set CurrentLine=CCCC
-
- setlocal enabledelayedexpansion
- echo !name!=!%%a!
- endlocal
- ))>b.txt
- pause
复制代码
|