- @echo off&setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('findstr /i "</td> <b><a" a.txt') do (
- set/a n+=1
- set str!n!=%%i
- )
- for /l %%i in (1,1,5) do (
- for /f "tokens=3 delims=<>" %%j in ("!str%%i!") do set "T=%%j"&set "T=!T:/= !"
- set/p=!T! <nul>>b.txt
- )
- echo.>>b.txt
- for /l %%i in (6,1,%n%) do (
- set/a s=%%i%%6
- if !s! equ 0 (
- for /f "tokens=4 delims=<>" %%j in ("!str%%i!") do set/p=%%j <nul>>b.txt)
- if !s! equ 1 (
- for /f "tokens=8 delims== " %%k in ("!str%%i!") do set/p=http://bbs.bathome.net/%%~k <nul>>b.txt)
- if !s! equ 3 (
- for /f "tokens=4,7 delims=<>" %%l in ("!str%%i!") do (
- set/p=%%l <nul>>b.txt
- set dt=%%m
- set dt=!dt: =-!
- set/p=!dt! <nul>>b.txt))
- if !s! equ 4 (
- for /f "tokens=3,5 delims=<>" %%m in ("!str%%i!") do (
- set pb=%%m
- set pb=!pb: =!
- set/p=!pb!%%n <nul>>b.txt))
- if !s! equ 5 (
- for /f "tokens=3 delims=<>" %%n in ("!str%%i!") do echo %%n>>b.txt)
-
- )
- pause
复制代码
|