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
Retaining the entire ID if there are certain variables in the panel dataGood Morning world
English is not my language so google help me. Please understand me.
I have stat…
Repeated time values within panel helpHi All,
I am having some trouble with understanding the xtset command even after reading through so…
Replacing missing values with draws from a subset of nonmissing valuesI am replicating an imputation procedure for a household survey, and I'm struggling to find a elegan…
Collapsing multiple variables using the count optionHi all,
I have a dataset where every row represents a study. Each row contains a column describing …
How to organize a dataset in order to have years in one column and countries in another columnHello,
I import data (related to one single variable "stringency" in excel to stata. However it app…
Subscribe to:
Post Comments (Atom)
0 Response to Loops to switch between different sub-folders
Post a Comment