I am trying to import and then append 1451 csv files
Below is my do file:
Code:
local filelist: dir "Macintosh HD/Users/rich/projects/ingrid parry/data/csv/csv_data/" files "*.csv" foreach f of local filelist { import delimited "Macintosh HD/Users/rich/projects/ingrid parry/data/csv/csv_data`f'", varn(1) stringc(_all) local f = subinstr("`f'", "csv", ".dta",1) save ""/Users/rich/projects/ingrid parry/data/csv/csv_data/`f'", replace }
Note that I tried with and without "Macintosh HD" and with and without a slash at the end of the first quoted material; before writing the above, I tried:
Code:
pwd /Users/rich/projects/ingrid parry/data/csv/csv_data
Code:
directory Macintosh HD/Users/rich/projects/ingrid parry/data/csv/csv_data not found
Code:
file /Users/rich/projects/ingrid parry/data/csv/csv_dataCIN0456.csv not found
as a second question, I want to then append all 1,451 files into one file - what is the most efficient way to do that please
Comment