贴个用数组的,可显示1~99行- @echo off
- setlocal enabledelayedexpansion
-
- set hanghao=一 二 三 四 五 六 七 八 九 十
- echo %hanghao%
- set index=1
- for %%a in (%hanghao%) do (
- set indexarray[!index!]=%%a
- call echo %%indexarray[!index!]%%
- set /a index+=1
- )
-
- set no=1
- for /f "delims=" %%a in (a1.txt) do (
- if !no! leq 10 (
- call echo %%indexarray[!no!]%%|%%a
- ) else if !no! lss 100 (
- set /a shiw=!no!/10
- set /a gew=!no!%%10
- call echo %%indexarray[!shiw!]%%!indexarray[10]!%%indexarray[!gew!]%%|%%a
- )
- set /a no+=1
- )
复制代码
|