Dear All, I have an "Controls.xlsx", in which, there are many sheets (names = 2020, 2019, ..., 2009) with same variables. I know that I can use
to import the data in Stata format. I wonder if there are alternative ways (say, xls2dta or others) ways to do so. Thanks.
Code:
cd "E:\@CIE\" forvalues i = 2009(1)2020 { import excel "raw\Controls.xlsx", sheet("`i'") firstrow case(lower) clear ren 期刊名 Journal gen year = `i' save "dta\Controls_`i'.dta", replace } use "dta\Controls_2009.dta", clear forvalues i = 2010(1)2020 { append using "dta\Controls_`i'.dta" }
Comment