试写了一段代码,分享分享,请老手们多多指教。。。- @ echo off
- setlocal ENABLEDELAYEDEXPANSION
- set "x=aA1一bB2二cC3三dD4四eE5五fF6六gG7七hH8八iI9九"
- set y=0
- set s=0
- : start
- del /q /f q%s%.txt>nul 2>nul
- : loop
- set /a y+=4
- if %y% ==36 set y=1 & call :dsp & call q.bat>dsp.txt & set s=1& goto start
- if %y% ==37 set y=2 & call :dsp & call q.bat>>dsp.txt & set s=2& goto start
- if %y% ==38 set y=3 & call :dsp & call q.bat>>dsp.txt & set s=3& goto start
- if %y% ==39 set y=4 & call :dsp & call q.bat>>dsp.txt & set s=0& goto end
- echo !x:~%y%,1!>>q%s%.txt
- goto loop
- :dsp
- echo @echo off>q.bat
- if %y%==1 echo echo a^^>>q.bat
- if %y%==2 echo echo A^^>>q.bat
- if %y%==3 echo echo 1^^>>q.bat
- if %y%==4 echo echo 一^^>>q.bat
- for /f "tokens=1 delims=" %%i in (q%s%.txt) do echo %%i^^>>q.bat
- goto :eof
- : end
- type dsp.txt
- pause>nul 2>nul
复制代码
|