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
Type missmatch, dropping string observations from a VariableHello, Starting a new thread since I finally need something different from what I had before. How…
Problems with spread out rows when using tableHi Statalisters, I seem to have found some unexpected (to me) behaviour from the -table- command. A…
Cross Sectional Dependence and PMGHi Everyone, How to calculate the Cross Sectional Depednace Test after estimating Pool Mean Group (…
Add mean, sd and median names to table outputHi all I wonder if its possible add mean, sd and median names to a table output , example: Code: …
Missing F-Stat for regression with robust SE - Not a problem with singleton dummy variables Dear Statalist community, Currently I am conducting an event study on ad hoc disclosures. The regr…
Subscribe to:
Post Comments (Atom)
0 Response to Append csv files into one dta file
Post a Comment