Converting multiple columns string into number

Dear Community

I am using CSV file reader to import the data. The dataset has multiple columns with values as follows:
Column1, Column2, Column3, Column4
Row0 35%, 100%, 99%, 87%
Row1 45%, 100%, 86%, 93% and so on

These columns are imported categorizing as string and i am unable to change the data type as number in transform tab in CSV reader.

Is there any node which changes the type of data in these columns into numbers in one go?

Regards

Hello @Mobihashim01,

there is String Manipulation (Multi Column) node that performs same operation on multiple columns and can be used in this case. You need to remove percentage char and use toInt() function. Something like this:
toInt(removeChars($$CURRENTCOLUMN$$,"%"))

Included column list should contain only columns that need to be converted.

Br,
Ivan

3 Likes

Hello @Mobihashim01,

You can use the String Configuration node.

For your reference, I have attached an image.

To state the obvious, you’ll also need to divide by 100 to turn the integer into a decimal to represent the %.

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