某崖的小说遇到值的读的,想提取到一文本集中阅读楼主。
多个网页下载合并后,已提取到源码内容为 发言人 下一行为发言内容。由于网友回贴,造成如下示例的内容间杂。所以还需要提取楼主的发言并其他加工。格式大致如下
<divclass="atl-info"><span>楼主:<ahref="http://www
<divclass="bbs-contentclearfix"> 爷爷是传承五代人的 这行留
<divclass="atl-info"><span><strongclass="host">楼主</strong>:<ahref="http://www
<divclass="bbs-content"> 床尾站着一小仙,男,中批 这行留
<divclass="atl-info"><span><strongclass="host">其他发言人</strong>
<divclass="bbs-content"> 其他发言人的发言,特点长短不一,也可能引用楼主大段文字
<divclass="atl-info"><span><strongclass="host">楼主</strong>:<ahref="http://www
<divclass="bbs-content"><br> <imgsrc="http://static.tianyaui.com/img/static/2011/imgloading.gif"title="点击图片 这行留
<divclass="atl-info"><span><strongclass="host">楼主</strong>:<ahref="http://www
<divclass="bbs-content"> 那日入定,爷爷带 这行留- @echo on&&setlocal enabledelayedexpansion
- for /f "tokens=1 delims=:" %%i in ('findstr /n "楼主" 33.txt') do (
- echo 楼主标志的行号 %%i
- set /a xy=%%i+1
- set js=
- for /f "delims=" %%m in ("33.txt") do (
- set /a js+=1
- if !xy!==!js! echo %%m>>44.txt
- echo 标准!xy! 计数!js!
- )
- )
- pause
复制代码 我尝试写的代码,计数!js!永远为 1,因此提不到楼主发言。所以求助,感谢给予帮助。 结贴时对上面略改 |