Code: Select all
@echo off
TITLE Get WORS Results
SET /P "RACENUM=What race number do you want to retrieve? : "
set "url=http://www.wors.org/results/2015"
(for %%G in (junior) do wget -O - -q %url%/%RACENUM%/overall/%%G.htm |^
jrepl "^((?:( DNF| NR)|.{5}).{80})(.*Broken Spoke.*)" ^
"$1+($2?' ':'')+$3+'\x22%RACENUM%\x22,\x22%%G\x22'" ^
/j /a |^
jrepl "(.{5})(.{9})(..)(.{6})(.{7})(.{26})(.{26})(...)(.{12})(.{12})(.{32})(.*)" ^
"f($1)+f($2)+f($3)+f($4)+f($5)+f($6)+f($7)+f($8)+f($9)+f($10)+f($11)+$12" ^
/j /jbeg "function f(str){return str.replace(/^\s*(\S(.*\S)*)*/,'\x22$1\x22,')}"
)>>ALL_Race_Results.csv
EDIT - Simplified the regex in the f(str) function
Dave Benham