Regex Pattern Matching in Rowsplitter node for non string columns

Hey,

can you tell me how the Regex Pattern Matching in Rowspliiter nodes is working for non string columns e.g. doubles? Is it recommended to be used or is it better to convert the type to string beforehand?

Thanks!

Hi,
can you explain the rule that you want to apply?
If column type is numeric perhaps we can find a rule without any transformatio…

Hi e.g. check if a value has at least 4 decimal places.
Regex:
-?\d+\.\d{4,}

Different from zero ciphers? Are you checking the value or the format?
Excuse me for these questions but I would understand if is it conceptually correct working on String values than working over number values.
So, if you can,can you give me an example your next choose: What do you will do if your number has al least 4 decimal ciphers? And if not?

Thanks

1 Like

Hey @pigreco I am only trying to check the format if the format is fine,
so 1.00000000 would work but also 1.2345 ; 1.23 wouldn’t.
So using regex seems like an appropiate way for me. The rowsplitter seems to be able to use regex on doubles but I would like to avoid running into strange errors.

If the format is fine I’ll use the number to make some calculation, if not I’ll raise an error.

Ok. According to me you, have to use a regular expression but I would do some test to verify behaviour with background number to string transformation.

Hi there @tbtt,

can’t say for sure but playing around with it would say numeric columns are treated as text when evaluated against given pattern (whether it is wildcard or regex) so believe you are safe to use it as planned.

Note: Don’t think you can have 1.000000 in KNIME :wink:

Br,
Ivan

2 Likes

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