Hi,
I'm stuck with a very simple problem of importing a bunch of csv files from s folder and appending them. The files cannot be imported through a loop so I have done the following:
This gives me error:
But I have checked in the folder, the file does exist, so not sure what's going on.
The folder weather has only these csv which are named like "1 Xyz", "2 Pqr" etc. I tried changing some names to all lower case, still getting the error.
Appreciate any help, thanks.
I'm stuck with a very simple problem of importing a bunch of csv files from s folder and appending them. The files cannot be imported through a loop so I have done the following:
Code:
global weather C:\Users\...\Dropbox\...\Input\...\...\weather global tempdata C:\Users\...\Dropbox\...\...\data\temp data clear tempfile weather save `weather', emptyok local filenames: dir "$weather" files "*.csv*" foreach f of local filenames { import delimited using `"`f'"' gen source = `"`f'"' display `"Appending `f'"' append using `weather' save `"`weather'"', replace } export delimited using "$tempdata\Rainfall_appended.csv", firstrow(variables) replace
file 1 xyz.csv not found
The folder weather has only these csv which are named like "1 Xyz", "2 Pqr" etc. I tried changing some names to all lower case, still getting the error.
Appreciate any help, thanks.
Comment