1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| @echo off
FOR /F "tokens=1,2 delims= " %%A IN (list.txt) DO CALL :Commande %%A %%B
:Commande
set id=%1
set url=%2
wget -O test_1.temp %url%
sed "s/http:\/\//\nhttp:\/\//g" < test_1.temp > test_2.temp
sed "/http:\/\//!d" < test_2.temp > test_3.temp
sed -f replace0.sed < test_3.temp > test_4.temp
sed -f replace1.sed < test_4.temp > test_5.temp
sed -f replace2.sed < test_5.temp > test_6.temp
sed -f replace3.sed < test_6.temp > test_7.temp
sed -f replace4.sed < test_7.temp > test_8.temp
sed -f replace5.sed < test_8.temp > test_9.temp
sed "/__http:\/\//!d" < test_9.temp > test_11.temp
sed "s/__http:/http:/g" < test_11.temp > test_12.temp
sed "s/.*/%id%;&/g" < test_12.temp > test_13.temp
rename test_13.temp %id%.tempx
for %%a in (*.tempx) do type "%%a">>z_final.csv
del *.temp
del *.tempx |
Partager