I have what I think it's a simple question.
I have a file named like this: 'prec/CHIRPS/P_CHIRPS.v2.0_mm-day-1_daily_2020.01.01.tif'
and you can see it has a date within.
I've used successfully the package datefinder
to extract the date from that string, but now what I want to do it's actually get the format from which datefinder
read that date. That means that I want an output to be '%Y.%m%.d%'
so I can use it to write a file with that same date format.
This is for example to be able to use whichever format of date and whichever file name I have, extract both the date and its format, and finally rewrite something like 'this is just an example of the file name with the date 2020.01.01'
.
Thanks!!