local files: dir "." file "*.xlsx", respectcase
foreach file in `files' {
import excel using "`file'", describe
forvalues i = 1/`r(N_worksheet)' {
import excel using "`file'", sheet("`r(worksheet_`i')'") ///
cellrange(`r(range_`i')') firstrow clear
save `file'.dta, replace
}
}
网友评论