
| Quote: | |
|
| Quote: | |
|

CODE: [Copy to clipboard]for /f %%? in ('sed -n "$=" test.txt') do (set n=%%?)
set/a n1=n-10
if %n1% lss 10 (echo 文件不足20行&pause>nul&exit)
sed "1,10d;%n1%,$d" test.txt|more>new.txt
CODE: [Copy to clipboard]@echo off
for /f %%i in ('find /v /c ""^<test.txt') do set num=%%i
set/a _num=%num%-10
for /f "skip=10 tokens=1* delims=:" %%i in ('findstr /n .* test.txt') do if %%i lss %_num% echo. %%j>>result.txt
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |