Board logo

标题: 提取指定行脚本 如果要提取第6行 [打印本页]

作者: 175891641     时间: 2008-12-25 22:23    标题: 提取指定行脚本 如果要提取第6行
rem 添加行号
findstr /v /i /n "0.0.0.0" 1.txt >>2.txt
rem 提取指定行
findstr /i "6:" 2.txt >>3.txt
for /F "tokens=1* delims=:" %%a in ('type 3.txt') do echo %%b>4.txt
del 1.txt
del 2.txt
del 3.txt

作者: lqh123108     时间: 2008-12-25 22:48
for /f "tokens=1* delims=:" %%a in (findstr /n .* 1.txt) do (
if %%a==6 echo %%b>>new.txt)

作者: HAT     时间: 2008-12-25 23:41
作者: fy2045     时间: 2008-12-26 17:34
Originally posted by lqh123108 at 2008-12-25 22:48:
for /f "tokens=1* delims=:" %%a in (findstr /n .* 1.txt) do (
if %%a==6 echo %%b>>new.txt)



方法好!

作者: slore     时间: 2008-12-26 17:35
skip=5
echo
exitfor