I have 132 *dta files (X1.dta to X132.dta) in the folder which must be exported to *txt file format and saved as 132 *txt files (x1.txt to x132.txt). I run the following code:
Code:
cd "C:\Users\by month" local allfiles : dir . files "*.dta" foreach f in `allfiles' { use `f', clear export delimited using `""C:\Users\by month\`m'"', replace }
0 Response to Loop over *dta files to export to csv files
Post a Comment