Hello,
I have 38 csvfiles that I want to merge into one DTA file using a loop (foreach) . My csvfiles are named in "2021-MM-YY.csv" format. The variable names are contained in one particular row (#Row 4) of the dataset and I want to also extract a certain range of rows (4-2940) from each csv file and bring it into the (Append ) data. I also want to extract the date out of the file name and store it in a date variable in the dataset, to be able to identify what date the particular observation is for. So far I have only been able to figure out this part of the loop to import the file, where I'm still confused about how to name the file appropriately in the path.
import delimited "files\2021-**-**.csv", delimiter(comma, collapse) varnames(4) encoding(UTF-8) rowrange(:2940) parselocale(en_IN)
Related Posts with Append csv files into one dta file
Hausman-Taylor estimator for binary dependent variableHi all, I am a business student who has had some introductory econometirc courses and has some basi…
correlation matrix set-up helpI'm trying to create a correlation matrix using the 'correlate var1 var2 var3...' command. I've got…
Identifying variables that serve as unique identifiersHello everyone I want to write a program that accepts numeric and string variables as input, that …
Interpreting VEC output with ranks higher than 1Dear STATA users, Although it feels like a simple question, I have spent a lot of time reading STAT…
Estimate coefficients to predict out of sample for the excluded quarter.Hi, I want to evaluate the model’s (reg lnUnmprate lnInflation lnFedfunds) ability to predict out of…
Subscribe to:
Post Comments (Atom)
0 Response to Append csv files into one dta file
Post a Comment