This import runs smoothly.
import excel "/Users/Sean/Dropbox/Mac/Documents/Research/DataSets/Environmental_Accounts/AIR_may12/LVA_AIR_May12.xls", sheet("1995") firstrow clear
This loop tells me that the above file doesn't exist (which of course it does). This file is halfway through the directory.
** 1995 **
clear
tempfile enviro
save `enviro', emptyok
local filenames: dir "/Users/Sean/Dropbox/Mac/Documents/Research/DataSets/Environmental_Accounts/AIR_may12/" files "*.xls*"
foreach f of local filenames {
import excel `"`f'"', sheet("1995") firstrow clear
gen source = `"`f'"'
display `"Appending `f'"'
append using `enviro'
save `"`enviro'"', replace
}
I have restarted stata, my computer, confirmed all files were in 'offline' mode of Dropbox.
Any ideas why it is upset with me? I should be appending .dta files at each step so that shouldn't be the issue. Similar code has run in the past, but also had this issue and I forget what I did to get it to work or if it just decided to work for me.
Thank you,
Sean
Comment