- @echo off&setlocal enabledelayedexpansion
- for /f %%i in (a.txt) do (
- set str=%%i&set str=!str:--= !&set "v="
- for %%j in (!str!) do (
- set var=%%j&set var=!var:330=200!
- set var1=!var:~0,4!
- if "!var:~-2,1!" equ "0" (set var2=!var:~-1,1!) else (set var2=!var:~-2,2!)
- set v=!v!!var1!年!var2!月--
-
- )
- echo !v:~0,-2!
- )
- pause
复制代码
|