Hello. I am attempting to append several .csv files (about 44) all from one folder. The files come from the same source so I attempted the following code:

Code:
clear* tempfile building

save `building', emptyok  

local filenames: dir "." files "*.csv"  

foreach f of local filenames {

insheet using `"`f'"', comma

gen source_file = `"`f'"'

append using `building'

save `"`building'"', replace

}
When I attempted it, I got the following error:

Code:
you must start with an empty dataset
r(18);
Any ideas on what I could be do? Stata novice here