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
generate a new variable (average over every two years)Dear StataList-ers! Help! I need somebody! My question is very basic. Panel data (countries, years…
format date variableHello, i have a date variable in my dataset which is type "long" and formated in the following way:…
Recognizing Texts ObservationsDear All, I have an issue with making STATA to recognize txt observations. I have a table that loo…
MlogitHi I am stuch with simple Mlogit. I appreciate help I am trying to see which regions are attracted b…
Dummy variablesDear all, I have a panel data (long data), shown below. Firm name Year Firm value Dummy A 1 …
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment