Hello KNIMErs
I have process I must KNIME and I have a solution, but I think the solution is horrible. Really horrible.
My process receives a string and from that string I need to extract / extrapolate / infer / calculate: the start date, the end date, the total length and the length from (what ever today is) until the end.
These strings come from different sources. The majority look like this: “125 years from 1 November 2004”. Some look like this: “999 years (less 10 days) from 1 November 1885” (with or without brackets), or this “999 years from and including 1 January 2020”, or this “From and including 25 December 1981 expiring on 24 December 2196”, or (my favourite) “125 years from 25 rstjsryjkdlkfyu 1997”, plus many other variants. Oh, and the date can come in any format (luckily I have not seen American date format).
My (horrible) solution it to have many filters that run in series e.g. if string starts “[0-9]{2,4} years from” then go to branch A, else go to branch B. Branch A: if string does not contain “including” go to Branch AA else go to branch AB and so on and so on and so on. Horrible!
Is there a better way?
Notes:
It does not matter in the date calculations are ± 1 day
Length figures are in months or years (rounded down)
I have about 22000 examples - i have attached 300
Book1.xlsx (13.5 KB)
Still on AP 4.7.7
Many Thanks
Frank
One more thing: I am not expecting a full workable flow as a reply. Ideas and skeletons (if required) would be amazing!

