Hi all, I’m quite new to Knime. Trying to figure out how to extract the right most values of a string in a column. Like on in Excel would use Right(String,Number_of_characters)
So an example of my data is I have a mix of date values, some including month, and some not. But at the end of the strings are always the year written in form YYYY. So like ‘01012020’ I would like to only use the right most four character ‘2020’. And I’d like to capture the year in a new column that is added to the existing table.
Does it make sense? How can I do this in Knime, is there a node for it or?
The suggestion by @JanDuo will give you the last 4 characters in the string regardless of their type. Have you tried that?
But at the end of the strings are always the year written in form YYYY. So like ‘01012020’
This is the only information you provided that hinted at what the strings look like. The regex I gave works as expected on strings such as ‘01012020’, ‘asdf2020’, ‘qwerty2010’ , ‘2015zxcvb’.
Now you say that the column in question contains a file name/url.
If you want more suggestions, you’ll need to post some example data and a workflow. Otherwise we’ll keep going in circles.
Thanks again, I got it working using the substring replace function, in the string manipulation node. So I assume it was something to do with the data in the column for manipulation, that had an impact on the other methods.