秋水 当前离线
上等兵
CrLf 当前离线
论坛巡查
@echo off (for /f "delims=" %%a in (user.txt) do ( if defined GID ( echo; %%a set "GID=" ) else ( set /p"=%%a" set "GID=1" ) ))>结果.txt复制代码
TOP
522235677 (张三)当前离线
少校
@echo off (for /f %%a in (user.txt) do ( for /f "tokens=1,2 delims=:" %%b in ("%%a") do ( if not "%%c"=="" (set /p=%%b:%%c <nul) else (echo %%b) ) ))>1.txt pause复制代码
这样行吗 522235677 发表于 2014-5-15 11:49
@echo off & setlocal EnableDelayedExpansion (for /f %%a in (user.txt) do ( set str=%%a if /i "!str:~0,3!"=="gid" (set /p=!str! <nul) else (echo !str!&echo.) ))>1.txt pause复制代码