I have a loop in Stata referring to a local macro which I use to run several actions (create a file, run script associated with each file etc.).
Everything is fine but I would like to change the order in which the files are read in the loop, which by default is alphabetical.
My loop looks as follows:
foreach file of local myfiles {
noisily display as text "some text"
}
Besides the display
command, the script continues with my code.
Is there a way to customize the order in which the loop addresses the files stored in the local macro?
I would like to achieve this without changing the file names.