I am trying to loop through a list of filenames in Stata. Filenames are of the type: CityName.dta
, CityNamePrices.dta
, etc.
I tool a look at this similar question but was not able to adapt it to my setup.
Here is the code I have tried:
local mylist Atlanta Boston Charlotte Chicago
foreach filename of local mylist {
use `"`filename'"'.dta
*Do some stuff here
use `"`filename'"'Prices.dta
*Do some more stuff here
clear
}