Dear Statlisters,
I have a folder that contains 40 csv files (OAEX1 to OAEX40). The first column is the same for all of them, but the second column is different. The columns are not labeled. i have tried the code below and other codes I found online but in vain. What i want to do is to merge all the csv file in one dat file to be able to some statistics etc... Your help is much appreciated.
Macrpo stat 15.1
I have a folder that contains 40 csv files (OAEX1 to OAEX40). The first column is the same for all of them, but the second column is different. The columns are not labeled. i have tried the code below and other codes I found online but in vain. What i want to do is to merge all the csv file in one dat file to be able to some statistics etc... Your help is much appreciated.
Code:
cd "/Users/aarredouani/Documents/csv" clear tempfile building save `building', emptyok local myfilelist : dir . files"*.csv" foreach file of local myfilelist { drop _all insheet using `"`file'"' local building = subinstr("`file'",".csv","",.) merge using "`building'" save `building', replace }
Comment