I am running a loop over several files, like:
Code:
local originals "/Users/onedrive/stata/files" // Defining the working directory local files: dir "`originals'" files "group*" // Define local files local dir1"/Users/onedrive/stata/newfiles"// Working directory for new files foreach f of local files { capture {... save `"`dir1'/`f'"', replace } if _rc!=0 { save `"`dir1'/break`f'"', replace } }
My question is, how to perform a do.file over several files that allows one specific file to break if there is an exception, while keeping the other files running into the loop?
Thank you and regards,
LR
Stata/MP 15.1 for Mac (64-bit Intel)
Revision 03 Feb 2020
0 Response to Loop of different files using capture
Post a Comment