- @echo off
- rem 全部保存为ansi
- cd /d "%~dp0"
- set /p str=input:
- for /f "tokens=1* delims=[]" %%a in ('find /n "%str%" ^< "1.txt"') do (
- if %%a leq 40 (
- set /a m=%%a+40
- call set n=%%n%% %%m%%
- )
- )
- for %%a in (%n%) do (
- (for /l %%l in (1,1,%%a) do (
- rem 如果只有1个,可以删除下一行的%%a
- set /p #%%a=
- )) < "1.txt"
- )
- set #
- pause
复制代码
|