回复 3# hlzj88
如下代码,可以达到楼主你的要求,在55.txt内,文字前面内容未去除- @echo off
- setlocal enabledelayedexpansion
- for /f "tokens=1 delims=" %%k in ('findstr /n .* 33.txt')do (echo %%k>>44.txt)
-
- for /f "delims=:" %%i in ('findstr /n .">楼主" 33.txt') do (
- echo 楼主标志的行号 %%i
- set /a xy=%%i+1
-
- for /f "tokens=1* delims=:" %%m in ('findstr .* 44.txt')do (
- set tt=%%m
- if !xy!==!tt! echo %%n>>55.txt
- )
- )
- del /f/q 44.txt
- pause
复制代码 最终结果(55.txt内容):- <divclass="bbs-contentclearfix"> 爷爷是传承五代人的
- <divclass="bbs-content"> 床尾站着一小仙,男,中批
- <divclass="bbs-content"><br> <imgsrc="http://static.tianyaui.com/img/static/2011/imgloading.gif"title="点击图片
- <divclass="bbs-content"> 那日入定,爷爷带
复制代码
|