How to pick up special Number

I have string data , as below, I want to pick up these number ,Thanks

Hello @Caibing and welcome back to the KNIME Forum.

Something that may work for your use case (only if the number of minutes is 2 digits) is to apply String Manipulation to extract the minutes value.

substr($raw data$,indexOf($raw data$, “mins”)-2,2)

However I’m sure there are more optimal solutions in case the minutes are more than 2 digits.

All the best,

Jose.

4 Likes

Hello @Caibing

If the number of digits is different to two and/or some occasional wording after “…mins”; you can test ‘String Manipulation’ node with the following code:

regexReplace($YourColumn$, ".*?(\\d+)mins.*$", "$1")

BR

5 Likes

Thanks,it can help me.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.