How do I replace 0 with 1 in a columns

Hi

I have a column that has numbers 0 to 6, the o is a data entry error and I need to replace that with 1,how do i do that

Hi @ajverma19 welcome to KNIME Forum

You can use a RuleEngine

$column1$ = “o” => “0”
TRUE => $column1$

or take the StringManipulation node to convert your column to Integer in one step:

toInt( replace($column1$,“o” ,“0”))

gr. Hans

3 Likes

Thanks, I have one related question

I want to converts all 0 (zeros) in a column to 1, how do I do that

Did you try the RuleEngine with

$column1$ = 0 => 1
TRUE => $column1$

assuming your column is of type Integer.

1 Like