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
Create a Pseudo Panel Data and AnalysisHello eveyone I would like to analyze the determinants of the dynamics of women's employment (15-49…
Choosing between Mean Group and Pooled Mean Group in ARDL modelsDear Stata users, Kindly help me with this problem. I am trying to choose the best model between t…
Using the ipdmetan functionHi, I am trying to run a two stage individual patient data meta-analysis and I have derived treatmen…
IV interpretation of result of test of endogeneity with weak instrumentsDear all, I will please like to find out a few things. I use OLS in my analysis and to address endo…
Getting common coefficient and restrictions in an equationI want to estimate an equation by setting restrictions to coefficients. Likewise, I want to get comm…
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment