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
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 you suggestion on writing a loop for the same so that I can append it accordingly
Thank you
Related Posts with Writing a Loop
Insignificant direct effect and significant indirect effect with -ldecomp- command (Mediating analysis)Hello! My name is Josep Maria Caroz and I am doing a research paper about the relationship between e…
Generating the average of the last 3 observed values of a variable in a panel dataDear Statalisters, I have a panel dataset and I'm struggling to generate the averages of the last 3…
Scatterplots or sepscatterHello statalist I have a question regarding scatterplots: I would like to have a scatterplot with c…
Conditional logistic regression analysis.I am doing a prediction model with conditional logistic regression. My odds ratios are greater than …
Plot predicted probability for dummies independent variableHi, I am using logistic regression analysis to test the effect of marital, employment and education…
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment