* G:\EU_leakage\weekly reports\083 - euro weather\loaddata * Howard Chong * Created: Jan 28, 2009 * Last Modified: /* This program loads and concatenates weather data */ clear set mem 100m set more off global DATADIR "G:\EU_leakage\weekly reports\083 - euro weather\downloads from dayton" * Generate a list of filenames in the DATADIR folder !dir "..\downloads from dayton\*.txt" /b > Filelist.txt * Now capture the filenames in a local list--need to do a bit of trimming first insheet using Filelist.txt levels v1, local(files) clean clear foreach name of local files { infix month 1-14 day 15-28 year 29-41 avtemp 42-50 using "$DATADIR/`name'" , clear local file5=substr("`name'",1,5) gen file5="`file5'" save `file5', replace } clear local firstflag=0 foreach name of local files { local file5=substr("`name'",1,5) if `firstflag'==0 { use `file5', clear local firstflag=1 } else { append using `file5' } } save WeatherEurope.dta, replace