Hi all,
I have many csv files that have one common variable (date) and one other variable. I would like to import them all to dta files and then merge them horizontally using the date variable.
I've used the following to try and create individual files, but for some reason some of the files are read as 1 var, and some as 2 var. The csv files are all from google trends and should be the exact same (except for different keyword searches).
How can I force the two columns in the csv file to be read as 2 separate variables?
Additionally, is there any way to merge all of them in one go according to date? Thanks in advance for any insight!
I have many csv files that have one common variable (date) and one other variable. I would like to import them all to dta files and then merge them horizontally using the date variable.
I've used the following to try and create individual files, but for some reason some of the files are read as 1 var, and some as 2 var. The csv files are all from google trends and should be the exact same (except for different keyword searches).
Code:
local myfilelist : dir . files "*.csv" foreach file of local myfilelist { drop _all insheet using "`file'" local outfile = subinstr("`file'",".csv","",.) save "`outfile'", replace }
Additionally, is there any way to merge all of them in one go according to date? Thanks in advance for any insight!
Comment