解答:
@echo off
for %%i in (*.dat) do call :goren %%i
goto end
:goren
set /p firstln=%1
set year=%firstln:~4,1%
if /i %year% GTR 0 (set month=0%firstln:~0,1% set day=%firstln:~1,2%) else (
set month=%firstln:~0,2% set day=%firstln:~2,2%
)
ren %1 c01-%month%%day%.cvs
goto end