第二问:- @echo off&setlocal enabledelayedexpansion
- if not exist new.txt (
- cd.>new.txt
- for /f "delims=:" %%a in ('findstr /n .* %1') do set "num=%%a"
- set /a num-=5
- for /f "tokens=1* delims=:" %%a in ('findstr /n .* %1') do (
- if %%a leq !num! echo %%b>>new.txt
- )
- ) else (
- for /f "skip=5 tokens=1* delims=:" %%a in ('findstr /n .* %1') do echo %%b>>new.txt
- )
复制代码 ----------------------------------------------------------------------
支持命令行*.bat *.txt格式,不知道为什么不支持拖放,郁闷中。。。。
[ 本帖最后由 batman 于 2010-11-26 18:11 编辑 ] |