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
Reducing estimated residual of our modelGoodmorning! Can someone explain me how to reduce the estimated residual of our model? …
Many points are overlapped, how to better plot the scatter? Code: * Example generated by -dataex-. To install: ssc install dataex clear input float a double b…
Factor analysis or similar data reduction technique for variables with different response options (binary and multiple response options)I am trying to create a variable that assess the construct of "knowledge" using participant's respon…
Number of stocksHello, I want to know that how many stocks are involved in my regression. Before regression the numb…
Tag time-invariant & time-varying variables in panelHi Statalist This probably has a very simple solution but I am struggling to figure it out. For a …
Subscribe to:
Post Comments (Atom)
0 Response to Writing a Loop
Post a Comment