Project

General

Profile

extract dates in file2 that exactly match the dates in file1

Added by Chris Fletcher over 12 years ago

Hi,

I have a file1 that contains data for an unevenly spaced sequence of years, say: 1930 1936 1940 1950 1966 1992, and file2 contains data for all years 1900-1999.

I can make the two files match in time by doing:
cdo selyear,1930,1936,1940,1950,1966,1992 file2 new_file2

But if I don't know in advance what the years are in file1, is there a simple way to extract only those years from file2? I suppose it will be a conditional selection on the times in file1, rather than on the value of file1.

Thanks in advance.
Chris


Replies (1)

RE: extract dates in file2 that exactly match the dates in file1 - Added by Uwe Schulzweida over 12 years ago

Hi Chris,

Conditional selection on the times is unfortunately not implemented in CDO.
You could use showyear to select the years from file1 and use this result as input for selyear.

Regards, Uwe

    (1-1/1)