keen 当前离线
荣誉版主
TOP
netbenton (秋风夜雨)当前离线
@echo off&setlocal enabledelayedexpansion for /l %%a in (3300,1,3315) do ( set #a=%%a for /l %%b in (1,1,9) do (set %%a0%%b=20!#a:~2,2!年%%b月) for %%b in (10 11 12) do (set %%a%%b=20!#a:~2,2!年%%b月) ) for /f "tokens=*" %%a in (a.txt) do ( for /f "tokens=1-3 delims=-" %%b in ("%%a") do (echo !%%b!--!%%c!--!%%d!) ) echo.&pause复制代码
zhouyongjun 当前离线
上校
@echo off&setlocal enabledelayedexpansion for /f "tokens=1-3 delims=-" %%a in (a.txt) do ( set/a y1=%%a/100,y1-=1300,m1=%%a%%100,y2=%%b/100,y2-=1300,m2=%%b%%100,y3=%%c/100,y3-=1300,m3=%%c%%100 echo !y1!年!m1!月--!y2!年!m2!月--!y3!年!m3!月 ) pause复制代码
评分人数
tab 当前离线
少将
curious 当前离线
二级士官
@echo off&setlocal enabledelayedexpansion for /f "tokens=1-3 delims=--" %%i in (a.txt) do ( call :aa %%i call :aa %%j call :aa %%k echo !b:~2! set b= ) pause>nul goto :eof :aa set a=%1 set a=!a:330=200! set a1=!a:~0,4!年 set a2=!a:~-2! if !a2! lss 10 (set a2=!a2:~-1!) else (set a2=!a2:~-2!) set a=!a1!!a2!月 set b=!b!--!a!复制代码
lengmoke 当前离线
列兵
@echo off setlocal EnableDelayedExpansion for /f %%i in (a.txt) do ( set str=%%i set str=20!str:~2,2!年!str:~4,2!月--20!str:~10,2!年!str:~12,2!月--20!str:~18,2!年!str:~20,2!月 echo !str:年0=年! )复制代码