Formatting negative values on the right

Hi everybody,

I am running a txt file that has negative values with minus sign on the right such as:

717,31
717,31-
216,55
216,55-
244,19
244,19-
10,58
10,58-

The column is a string and it seems I can’t turn it into a number’s one. How can I move the sign on the left and turn into numbers?

Thanks a lot

Hi @Andrea-Cagnazzi and welcome to the KNIME forum,

You can use this expression in the String Manipulation node:

regexReplace($column1$, "(.*)-", "-$1")

where column1 is the name of the column. Then you can use the String to Number node to convert the column type.

:blush:

3 Likes

Thank you very much!!!
:slight_smile:

2 Likes

Hi there @Andrea-Cagnazzi,

welcome to KNIME Community Forum!

There is a feature request (internal reference: AP-13655) for String To Number node to handle this type of conversions so I will give +1 for you.

Br,
Ivan

2 Likes

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.