I am working with join expressions under the ‘String Manipulation’ node.
I would like to be able to concatenate strings, however, if one of the columns’ value its been used to concatenate has spaces, I must use “double quotes” to handle that specific case.
For example:
color
carName
black
Jaguar
blue
BMW
white
Jeep Grand Cherokee
Output:
black Jaguar
blue BMW
white “Jeep Grand Cherokee”
“I understand about the difference between brands and names of vehicles, but you get the point…”
Handling the space:
I thought of using the ‘Rule Engine’ node but can’t figure out if in it has an expression to handle IF FOUND like in Excel we have, ISNUMBER(SEARCH) . I have tried:
< " " IN $carName" => TRUE > then I append a column (spaceFound) w a true or false for later handling by the double quote function
also tried:
" " MATCHES $carName" => TRUE
both do not work
concatenating w join:
I am concatenating with join as:
join($color$, < if value is TRUE on (spaceFound) col , then > DOUBLE QUOTES,$carName$,DOUBLE QUOTES ) [adding the double quotes to the beginning and end of the value of $carName"]
Before jumping towards a solution, just a double check:
Is your desired output only to quote the carName column whenever it contains a space like in the Output:?
Because in your pseudo code I see you doing join($color$, so I’m assuming the desired output is actually one string saying white “Jeep Grand Cherokee”
It checks if the carName contains a space, resulting in true or false.
If true, create a string by concatenating: the color, a quote, the carName and another quote. Key here is that you have to escape the quote since it’s a special character. This is done with the backslash.
If false, concat only the color and carName with a space in between.