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
Vectorized divisionHi All, I have the following dataset. test2=sums_of_squares_weight/total_passenger_perday_adjusted …
distcomp now on SSCThe command distcomp (distribution comparison) is now available on SSC, thanks to Kit Baum. It's lik…
Window issue in Stata 17Hi Stata users, I am using a user written command that can be found http://www.who.int/entity/healt…
covs() not allowed in rdrobstDear statlists, I have a very brief question, but I cannot wrap my head around why this doesn't wor…
Treatment , Post Treat in case of heterogeneous treatment timingHello all, Would like to create an event study but I'm trying to make sure I'm creating treatment, …
Subscribe to:
Post Comments (Atom)
0 Response to Append csv files into one dta file
Post a Comment