Column Expression: Add option to strip whitespace in split function

Hi,

I start to love the column expression node quite a lot due to it’s versatility. Though, I just noticed that splitting like bug, python, database a string into an array, will keep the leading white space.

Hence, I’d like to suggest to add an config option to strip / remove leading and trailing whitespace. Here you see the duplicated whitespace in the result:

image

My formula to convert a string into a collection:

split(replaceChars(column(variable("currentColumnName")), "[]", ""), ",")

Best
Mike

To be honest I don’t see KNIME jumping in on a such request because this will lead to a situation without end. Why would would strip be a config in CE but others not, like upper/lower, remove duplicates? Moreover, just adding strip() to your formula would also do the trick.

I’d say this request would be in line with an earlier proposal for a node similar to how Pentaho handles this.

Which is now, btw, covered by the new String Cleaner node.

1 Like

The Column Expression Node is a generic and quite awesome node. I suggested this for consistency reasons. Though, your point is valid but rather points towards the approach philosophy of Knime whenever they rather tend to stick to a “sub-atomic” principle where individual nodes provide specific functionality, a “moelcular” approach where node(s) can fulfil multiple tasks at once or striking a balance between them.

I can imagine that, given sufficient dev time has passed, that a certain level of functional overlap is not avoidable.