Dear all,
I am trying to import a folder with .csv files to stata. Each file corresponds to a month of data, and they cover the period January 2013 to December 2020.
I am using the following code:
clear all
cd "${folder}"
local satafiles: dir . files "*.csv"
foreach file of local satafiles {
preserve
import delimited using "`file'", clear
save temp,replace
restore
append using temp
}
rm temp.dta
save "${folder}dataset", replace
clear all
However, I get the error "temp.dta not found".
Is there any typo/mistake in the code?
If someone could help, that would be great! Thanks!
Related Posts with Import a folder with .csv files
Help generating and analysing a repeated variable conditional on a specific baseline time-point and value.Hi Stata Forum I have an unbalanced set of panel data with individuals having a measurement at base…
Group averages and assign them to a specific dateHi, I am trying to make average of the median EPS that have been forecasted 90 days before the earn…
New on SSC: mlincom - multiple linear combinations of parametersThanks to Kit Baum, a new package mlincom is now available from SSC. mlincom (multiple lincom) comp…
Oaxaca threefold decomposition and selection: how to interpretDear all, I am struggling with a selection problem and I would like to know your feedback about it: …
Seasonality line graphHi, I have a panel dataset for 308 authorities from 2014Q1 to 2018Q4. My dependent variable is HDRR …
Subscribe to:
Post Comments (Atom)
0 Response to Import a folder with .csv files
Post a Comment