Code: Select all
@echo off
setlocal enabledelayedexpansion
call :sar filein.htm fileina.htm "<div style=.display:none.>[0-9]*<\/div>" ""
call :sar fileina.htm file.htm "<span style=.display:none.>[0-9]*<\/span>" ""
htmstrip /-table /border=b file.htm
find "TP" <file.out |find /v ">" >file.txt
for /f "delims=" %%a in (file.txt) do (
set var=%%a
set var=!var:~11!
for /f "tokens=1-6" %%b in ("!var!") do (
if /i "%%f%%g"=="High+KA" echo %%b,%%c,%%d,%%e,%%f, %%g
)
)
pause
goto :EOF
:sar
::Search and replace
@echo off
if "%~3"=="" (
echo.Search and replace
echo Syntax:
echo %0 "filein.txt" "fileout.ext" "regex" "replace_text" [first]
echo.
echo. if [first] is present only the first occurrence is changed
goto :EOF
)
if "%~5"=="" (set global=true) else (set global=false)
set s=regex.replace(wscript.stdin.readall,"%~4")
>_.vbs echo set regex=new regexp
>>_.vbs echo regex.global=%global%
>>_.vbs echo regEx.IgnoreCase=True
>>_.vbs echo regex.pattern="%~3"
>>_.vbs echo wscript.stdOut.write %s%
cscript /nologo _.vbs <"%~1" >"%~2"
del _.vbs