I need help asap... been struggling with this for past 3 hours!!

I was looking at previous answers to this but it does not work on mine. I need to change a string in a column from “22yrs 6mon” to months only. Please let me know how to do this? It is very urgent!!

You could use a Regex in the Expressio node

parse_int(regex_extract($["duration_txt"], "(\\d+)(?=mon)", 1))

RegEx Split String - KNIME Forum (89900).knwf (50.2 KB)

3 Likes

Below Simple workflows gives the output you requested. Can you check this?

Expression Used:

parse_int(first_chars($["Date String"],2))*12 + parse_int(substring($["Date String"],7,1))
6 Likes