@echo off
setlocal enabledelayedexpansion
set "path=./"
set "brdc=cask"
set "n=g"
for /l %%i in (2003,1,2017) do (
set year=%%i
set year2=!year:~2,2!
for /l %%j in (1,1,365) do (
if %%j lss 100 (
if %%j lss 10 (
set doy=00%%j
) else set doy=0%%j
) else set doy=%%j
move %path%\!year!\!doy!\%brdc%*.Z %path%\%brdc%\!year!\
rd /s/q %path%\!year!\!doy!
)
rem 解压
echo decompress year !year!
gzip.exe -df %path%\!year!\%brdc%*.Z
)