The blog post on the Stata Blog has helped me a lot in creating a loop to download folders at once ( https://blog.stata.com/2010/12/01/au...ile-unzipping/ )


All the files followed the structure " DO@@yyyy.dbc " where @@ = acronym of each state and yyyy = year (4digits)


So I was doing

Code:
local groups " AL CT NJ PA "
forvalues i = 1996/2010 {
foreach x of local groups{ 
copy http://example.com/DO`x'`i'.dbc DO`x'`i'.dbc 
}
}

However, now that they changed the structure of the file name to " DO@@yymm.dbc ", I am having troubles. In the file name structure "mm" varies from 01 to 12 and "yy" from 08 to 18. However, theforvaluefunction does not recognize the first 0, making the download fail.

Does anyone have any advice on how to solve this problem?