Hello - I am attempting to import all excel sheets from a specified folder, and save as STATA files. I am using the following code, and do not receive an error message - but no files are imported. Can anyone detect an error, or have an alternate solution to this problem?
local files : dir "G:\CTRHS\CCHE\Projects\KFHP - MELO\14. Virtual Care Initiative\3--Data\Clinical Data\Baseline data downloads\AP" files ".xlsx"
cd "G:\CTRHS\CCHE\Projects\KFHP - MELO\14. Virtual Care Initiative\3--Data\Clinical Data\Baseline data downloads\AP"
foreach file in `files' {
import excel using `file', sheet("Backend for data export ") firstrow clear
local hcid = HC_ID[1]
save "`hcid'.dta", replace
}
Related Posts with import all excel sheets from a specified folder, and save as STATA files
Help merging excel files in stata with 3 variablesI have 3 excel files with poverty data at the county level for the years 1980,1990, and 2000. I have…
Help on fixed effectsDear all, I'd need some advice on how to deal with fixed effects. I am currently working on a cross…
Help needed: creating flag to Identify at least 3 consecutive years of data (without discarding other cases)Dear Sir/Madam I have a panel dataset (each company has one or multiple years of data, but there ar…
Reverse a numeric variableHi all, so i have a numeric variable with a lot of values, that are decimal: 4,626276 5,162374 5,6…
mi impute chained trace plotsHi all, I am running the command mi impute chained (regress) x y z = a b c, add (10) burnin (100) r…
Subscribe to:
Post Comments (Atom)
0 Response to import all excel sheets from a specified folder, and save as STATA files
Post a Comment