Today I touched the problem with Cell Splitting. I have the column “Location”. I need to split all part into separate columns. The most important thing that I need to have at least one column with Country. Due to the fact that in case of USA, here in the cell I have the name of the state I have such problem (see the pic 2). How to combine / join USA with the rest countries into one column? And the State leave as it is in the separate one?
I‘d personally prefer using RegEx but without sample date to work with I cannot create on for you. In your case you might just use a Rule Engine to copy the String from the fore last into the last column if the cell
Is missing. Then another rule engine to flush the original value.
@yogesh_nawale the problem is that USA is in the Location_Arr[3], so it means that I need to leave it there and put the other countries into Location_Arr[3] and leave the
in the Location_Arr[2]. I have no idea on the script, because I’m a beginner(((
States
It seems the same as yours… but again the error… when I delete the word “column” the values become Location_Arr[2] in the required column… if I leave it, then I have the error…see the pic 1. The second expression seems ok, see the pic 2.
I need to understand why, because I’m a student… and this is my home task… I need to do it…
Hey @Felis90,
Yes you can also use single quotes. Sometimes double quotes gives error depending on the expression used. This happens because of how the node interprets different types of expressions or contexts. However, KNIME is more consistent and predictable when using single quotes for string comparisons or literals.