sweet惜缘 当前离线
二级士官
wankoilz 当前离线
上尉
@echo off & setlocal enabledelayedexpansion (for /f "tokens=1,2 delims=0,1,2,3,4,5,6,7,8,9" %%a in (NEW_GPCR-DG.txt) do ( for %%c in (%%a %%b) do ( if %%c==D (set /a D+=1&set/p=1.!D!<nul) else (set/a DG+=1&set/p=2.!DG!<nul) ) echo; ))>out.txt复制代码
TOP
pcl_test 当前离线
荣誉版主
@echo off setlocal enabledelayedexpansion set /a n=m=0 (for /f "usebackq delims=" %%a in ("NEW_GPCR-DG.txt") do ( for %%b in (%%a) do ( set "str=%%b" if "!str:~,2!" neq "DG" ( if not defined %%b ( set /a n+=1 set /p=1.!n! <nul set "%%b=1.!n!" ) else (set /p=!%%b! <nul) ) else ( if not defined %%b ( set /a m+=1 set /p=2.!m! <nul set "%%b=2.!m!" ) else (set /p=!%%b! <nul) )) echo; ))>"NUM_DG.txt" pause复制代码
apang 当前离线
上将
@set @n=0;//&cscript -nologo -e:jscript "%~0"<NEW_GPCR-DG.txt>DG.txt & pause & exit/b var i = 0, j = 0; var s = WScript.StdIn.ReadAll(); s = s.replace(/D\d+/g,function(s0){return "1." + ++i}); s = s.replace(/DG\d+/g,function(s0){return "2." + ++j}); WScript.Echo(s)复制代码