Using wget to get an excel files with FOR loop syntax on batch/CMD (*.bat)
programing
Refer to My question Looping using FOR in batch (*.bat) / CMD.
I want to use wget to get an excel files.
excel01.xls --> link : http://portal/excel01.xls
excel02.xls --> link : http://portal/excel02.xls
...
excel12.xls --> link : http://portal/excel12.xls
My code :
echo off
set /P start= Input start : %=%
set /P end= Input End : %=%
for /l %%i IN (%start%,1,%end%) DO echo wget "http://portal/excel0%%i.xls"
pause
Result :
Input start : 1
Input End : 12
wget "http://portal/excel01.xls"
wget "http://portal/excel02.xls"
wget "http://portal/excel03.xls"
wget "http://portal/excel04.xls"
wget "http://portal/excel05.xls"
wget "http://portal/excel06.xls"
wget "http://portal/excel07.xls"
wget "http://portal/excel08.xls"
wget "http://portal/excel09.xls"
wget "http://portal/excel010.xls"
wget "http://portal/excel011.xls"
wget "http://portal/excel012.xls"
Press any key to continue . . .
how the correct script that results in row 10-12 :
wget "http://portal/excel010.xls"
wget "http://portal/excel011.xls"
wget "http://portal/excel012.xls"
become
wget "http://portal/excel10.xls"
wget "http://portal/excel11.xls"
wget "http://portal/excel12.xls"
I'm sorry I do not speak English very well. :)
No comments:
Post a Comment