I use a “table creator” to create a list of rules which are then fed to a “rule-based row splitter (dictionary)”
The rules are of the form:
$colname$="somevalue" TRUE
I have created this setup multiple times already and it is working fine. However, some of the string values I need to compare contain doublequotes. According to the official documentation, they need to be scaped using a backslash. I tried that in various permutations, but it always fails.
If the column is a type of Number then you don’t need the double quotation marks. $colname$ = 5
But if it’s a String then just simply input the double quotes without any backslashes like this: $colname$ = "5"
This works if you are creating the rules in a table creator node.
If you were creating rules in some node like string manipulation using some function like join, then you would need backslashes before each mark surrounding the value ($colname$ = \"5\").
You didn’t understand my question. To clarify:
I am not interested in matching 5 but 5". So $colname$ = "5" doesn’t help me.
According to docs, the solution to my problem is $colname$ = "5\"" but it isn’t working. Either this is a bug or the documentation is incomplete/outdated. I assume there is some non-standard way to describe this, because a single equals sign is not commonly used to compare two values. Must be something KNIME specific that isn’t obvious and I’d like to know what it is.
For those slashes inside your string you can use a backslash to escape.
For example if you have a string like this:
5"some text/some other text/some other text
Then the rule would be like this: $colname$ = /5"some text\/some other text\/some other text/