I have several .dta files in a folder. For each file, how can I convert all the variables to string? That is, I want to apply the following code to all files.
Code:
tostring *, replace
xls2dta ... : import excel ... xls2dta : xeq tostring *, replace
clear* local filenames: dir "." files "*.dta" foreach f of local filenames { use `"`f'"', clear tostring *, replace save `"`f'"', replace }
clear set obs 1 gen x = 1/3 list tostring x, replace foromat x %13.12f list
Comment