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
Import variables created by svmatDear Stata users, I create variables from matrix which got from a regression, a tabulation, or any …
Counting years in panel dataHi all, I'm trying to create a count variable for the number of years a factory has been in product…
Underlying Computation of regress functionI know STATA is written in C. Does anyone know if C calls FORTRAN for the dqrls subroutine? Or does …
Problems displaying triple interactions in esttab and coefplotHi everyone! I am currently trying to display a coefplot with the coefficients of multiple regressi…
Extent Indicators, Zooming and Clearer Maps with grmapI'm doing a synthetic control analysis of COVID-19 vaccine mandates in the United States, and I want…
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment