doscode, show us the source code and then state what you need from it, and give an example.
People will quickly lose interest if you ask for one thing, but then you change what you need in the next posts.
Help with grep in for loop
Moderator: DosItHelp
Re: Help with grep in for loop
I have the code done, for the second site:
http://www.proxynova.com/proxy-server-list/
http://www.proxynova.com/proxy-server-list/
Code: Select all
@echo off
Setlocal EnableDelayedExpansion
SET proxy_1=Proxy_1.htm
SET proxy_2=Proxy_2.htm
for /f "delims=" %%x in (delimiter.ini) do set TAB=%%x
if not exist %proxy_1% (
echo File not found
pause
exit
)
REM FOR /F "tokens=7,12,15 delims=<>" %%A IN ('grep -B 25 "</td></tr></tbody></table>" !proxy! ^| grep high') DO ( echo %%A %%B %%C )
FOR /F "tokens=3,4,5 delims=<>" %%A IN ('grep -B 810 -E "<th colspan=.10.> </th>" !proxy_2! ^| grep -E ^"row_proxy^|port^|country^|proxy_^" ') DO (
REM echo 1: %%A 2:%%B 3:%%C
if "%%C" == "/span" SET ip=%%B
if "%%C" == "/a" SET port=%%B
if "%%B" == "/a" SET location=%%A
if "%%B" == "/span" (
SET A=%%A
SET A=!A:"=$!
FOR /F "tokens=1,2,3 delims=$ " %%S IN ("!A!") DO (
SET type=%%U
SET ready=1
)
)
if !ready!==1 (
echo IP:!ip!:!port! in !location! is !type!
SET ready=0
pause
)
)