its pretty hard to find a title for my question because its very specific.
My problem is: I have around 9000 files of data collected over different periods. The filenames contain that periods and I only want to load that files into R, that contain at least 17/18 years of data collection.
I created a testlist to show what I mean:
list = c("AT0ACH10000700100dymax.1-1-1993.31-12-2003",
"AT0ILL10000700500dymax.1-1-1990.31-12-2011",
"AT0PIL10000700500dymax.1-1-1992.31-12-2011",
"AT0SON10000700100dymax.1-1-1990.31-12-2011",
"AT0STO10000700100dymax.1-1-1992.31-12-2006",
"AT0VOR10000700500dymax.1-1-1991.31-12-2011",
"AT110020000700100dymax.1-1-1993.31-12-2008",
"AT2HE190000700100dymax.1-1-1993.31-12-2000",
"AT2KA110000700500dymax.1-1-1991.31-12-2010",
"AT2KA410000700500dymax.1-1-1991.31-12-2011")
These are the filenames. And now I want to extract all filenames that contain measurements that are at least 18 years long. For example the 1st file should be taken out because the periode is too short, the 2nd one is fine. So I have to create something that either compares the dates (only the years) or something like startyear + 18.
Oh and the file names dont have the same length! This is only an example.
I have no clue how to do that. Can somebody please help?