Dear Statalist Users,
I have multiple txt files and I want to convert them into stata files so that I can append the data.
This is the manual way of importing the data and then saving it for stata.
import delimited "C:\Dir\Manu - 00-01.txt", delimiter("|") varnames(2)
rename v1 company
rename v2 product
save "manu_00-01", replace
However, I have 20 text files in the form of Manu - 00-01.txt, Manu - 00-02.txt, Manu - 00-03.txt, and so on till Manu - 18-19.txt.
I seek your suggestion on writing a loop for the same so that I can append it accordingly
Thank you
Related Posts with Writing a Loop
lclogit-Latent Class (Pacifico and Yoo)Dear members, I am using lclogit for fitting latent class conditional logit models with the guide p…
How to apply bias correction for dynamic panel data model with fixed effects - Hahn and Kuersteiner (2002)?Dear Statalist Community, I want to estimate a dynamic panel data model with fixed effects. The mod…
Help generating variables incorporating multiple conditionsHello for a bit of context here are some descriptions of the variables: ano_nac is the year the bir…
local commandDear All, Is it possible to have a more concise way to do the following: Code: local dropv "o.2007y…
Data Cleaning: Calculate DateHello, I have the following dataset, I need to check if drug date is done after the death date: Give…
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment