I have two files, each with 3 variables.
The first one has date, city, and score. The second one has date, city and ret. Each has 49 cities.
I want to split each files to 49 stata files, by city.
Then merge the 49 score files with the 49 ret files by city and date.
Then merge each of the 49 files with a fulldate file (only one variable date with all the 365/366 dates per year).
merge 1:1 date using fulldate
Then for the 49 files, each
replace city="cityname" if missing(city)
Then append all the 49 files to one file.
Anyone can help?
Great thanks!
Related Posts with Split to multiple files, merge and append
How forum software deals with Unicode whitespaceThe following dataex output contains several uchar(160): Code: * Example generated by -dataex-. T…
Rename the list of variables with the name of each sheet*Hi, I am importing 3 sheets from excel and I want to rename the list of variables with the name of e…
Margins : marginal effects for all observationsHello, I'm currently running into some issue with margins. I'm estimating 2 models, a fractional …
Margins after REGHDFE with log dependent variableI am using the reghdfe command with a log dependent variable. Then, I am using the margins command f…
Generating cross-sectional information from employment spellsHi all, I am currently working with a polish data set and would like to generate the professional e…
Subscribe to:
Post Comments (Atom)
0 Response to Split to multiple files, merge and append
Post a Comment