- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in (1.txt) do (set/a n+=1&set n!n!=%%i)
- if !n! lss 1000 (echo 不足1000行 & goto lp1) else (echo 超过1000 & goto
- lp2)
- :lp1
- for /l %%i in (1 1 !n!) do echo !n%%i!>>2.txt
- pause&exit
- :lp2
- set/a m=!n!-1000+1
- for /l %%i in (%m% 1 !n!) do echo !n%%i!>>2.txt
- pause
复制代码
|