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
Group differences of transition frequenciesHi everyone, I am trying to estimate group differences of transition frequencies. I have a unbalance…
Vlookup style function of variable from other datasetDear all, I come to you as I face a problem that sounds easy but I have stuck for good. I have two …
Laptop for running stataI am in the market for a new laptop that would allow me to run large datasets in Stata. Is an 8th ge…
kmatch bandwidthI am running Stata 14.2 on Win 7E. I'm using propensity score matching on some observational data. I…
Create a variables based on consecutive years of observationDear Stata Users, Please, help me to resolve the following issue. Below is the sample of data that I…
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment