Quantcast
Channel: Statalist
Viewing all articles
Browse latest Browse all 72762

Most efficient way of handling these two files?

$
0
0
Hi All,
If anyone could suggest a code or a different way to look at this problem I'm having:

Using a simplifed version of my sample:


I have one main file with rainfall amounts by clusters(c)

year c1 c2 c3 c4
1930 5 10 15 20
1931 10 20 30 40
1932 20 40 60 80
1933 1 2 3 4
1934 2 3 4 5
1935 7 8 9 10
1936 6 4 2 1



Then I have another file :
year c
1932 2
1936 3
1931 3
1932 4
1930 1
1934 2
1930 1


I'm trying to merge the rainfall values from the first file to the appropriate clusters and years in the second.
So I want my file when merged to look like:

year c Rainfall
1932 2 40
1936 3 2
1931 3 30
1932 4 80
1930 1 5
1934 2 3
1930 1 5

Is there a way to accomplish this?

Viewing all articles
Browse latest Browse all 72762

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>