I have 62 files that are numbered in sequential order (1,2,3...) that I want to merge into and update a single .dta file. However, I have taken suggestions from multiple forums but am still getting a message that the file can not be found. Below is the code I am using
Code:
***Sheet with all merged data use "/Users/seandocking/Documents/Work/MONSTERs Research/Environmental impact of MBS-subsidised imaging/Service data extracted 220321/untitled folder/Merged file.dta" foreach num of numlist 1/62 { merge m:1 Service using "/Users/seandocking/Documents/Work/MONSTERs Research/Environmental impact of MBS-subsidised imaging/Service data extracted 220321/untitled folder/dta/'num'.dta" , update drop _merge }
Thanks,
Sean
0 Response to Trouble merging multiple files with a loop
Post a Comment