Hello all, would appreciate an advise on how i can fix the following line of commands to import/read multiple SPSS files in a directory and save each as .dta file. The commands below do not produce any output or give an error message --
global dir "C:\Users\mydesktop"
local fls: dir "$dir" files "*.sav"
global save "$dir/STATA"
foreach f of local fls{
usespss `"`fls'"' , clear
save "$save/`"`f'"'.dta", replace
}
Related Posts with Forloop to import multiple .sav files not working
Canonical two-way fixed effects with cross sectional id and time t: two stage procedure gives almost, but not exactly what I expect.Good evening, I have been reading the literature for estimating two way fixed effects models, and i…
Loop same code through different directoriesHello, I have 10 network directories containing a number of .dta files. The data files, in each dir…
string variable managementGood afternoon, I would like to create a categorical variable from a string variable composed by sev…
Difference-in-difference robustness (all control variables interact with #post)Dear sir/madam, I found a paper where the authors use a difference-in-difference approach and as a …
Appropriate model for researchHi there. Firstly,as it is my first ever post, i want to thank everyone for the valuable information…
Subscribe to:
Post Comments (Atom)
0 Response to Forloop to import multiple .sav files not working
Post a Comment