What is wrong with commands in this Stata do-file? I am trying to open all batch files that are in separate sub-folders named Batch1-Batch2-..... to Batch32. These subfolders are in Output folder.
Also is there any way to append them using loops in Stata rather than doing one by one?
clear all
gl outputs "E:\Outputs"
forvalues i = 1/32 {
import delimited "$outputs/Batch`i'/batchfile.tab", clear
tempfile batchfile_`i'
save `batchfile_`i''
}
Related Posts with Loops to switch between different sub-folders
Dark themeI have STATA 17 on Linux. I use a Linux dark theme for my desktop. Stata generally respect the the…
Clustering Industry typesI have constructed the following one year lagged regression of ESG on ROA. However, I do not get an …
For elimination a specific group in a variable X on panel dataDear All users, I try to panel regression using panel data. I need to capture effect here that, Yi…
define a dummy with cond()Dear All, Suppose the data set is Code: * Example generated by -dataex-. For more info, type help d…
t-test to check if two means are statistically differentHi, I have a dataset like this. Each patient has multiple admissions and cost corresponding to that…
Subscribe to:
Post Comments (Atom)
0 Response to Loops to switch between different sub-folders
Post a Comment