Stata version: 12.1
I get an error "file not found" using this code:
cd "$path_in"
insheet using "df_mcd_clean.csv", comma clear
append using "df_mcd15_clean.csv" #where error happens
append using "df_ingram_liu1998_clean.csv"
append using "df_wccd_clean.csv"
I double checked that the file is indeed called that and located in the directory.
CodePudding user response:
append is for appending .dta files. Therefore, if you ask to append foo.csv Stata assumes you are referring to foo.csv.dta, which it can't find.
The solutions include
Combine the .csv files outside Stata.
Read in each .csv file,
saveas .dta, thenappend.
The current version of the help for append says this:
appendappends Stata-format datasets stored on disk to the end of the dataset in memory. If any filename is specified without an extension,.dtais assumed.
and that was true too in Stata 12. (Whether the wording was identical, you can say.)
