先来抛砖,拿来献丑了,看下是否是这样的输出:- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%a in (a.txt) do (
- set "str=%%a"&set "var="
- set "str=!str:330=200!"
- for /f "tokens=1-3 delims=-" %%i in ("!str!") do (
- set/a i=%%i,j=%%j,k=%%k
- for %%s in (i j k) do (
- set "c=!%%s:~-2!"
- if "!c!" neq "10" set "c=!c:0=!"
- set "var=!var!!%%s:~,4!年!c!月--"
- )
- echo !var:~,-2!
- ))
- echo.&pause
复制代码 在excel表格中操作,我也不知如何完成,对OFFICE一窍不通,求教高人。
[ 本帖最后由 pusofalse 于 2008-9-10 19:43 编辑 ] |