How to remove % sign in KNIME

Hi,

I have the % sign in my excel sheet and I want to remove the % signs in KNIME, I have used the string manipulation node to do this but it is not working 

 

I have also attached my excel sheet so you get what I mean

You could as well use File Reader with the CSV format ...

What function did you use in String Manipulation node ?

Have you tried the String To Number node ? Another possibility, for the % in numeric columns, is to use something like substr($your column$, 1, length($your column$) - 1)

Hi 

I dont know wether I used the right function but I used the removeChars(str) function and I didnt try that node 

what would be the correct function to use 

the substr (string manipulation) in my previous post would do the job for numbers followed by %

String Manipulation ->

regexReplace($column1$,"\%","")

column1 containing your percentages, as string column.

then convert with string to number.

Hi Docminus,

That expressions works but its only letting me remove it for one column, I have been using this expression to remove the % sign on more than one column but its not working. This is the expression I have been using to remove the sign on more than one column regexReplace($Col48$,$Col46$"\%","").

Can you please tell me where am going wrong I would appreciate it?

Geo I would also like thankyou for your help

you can only use one column in regexreplace. Loop over variables to repeat the process.

How would do I it for every column using a loop

"Column List Loop Start" --> "String Manipulation" --> "Loop End (Column Append)"

Cheers
E

what would the function be i'm using the same function as listed above but its giving me errors

Oh yes, sure - sorry! You need to apply your formula to the “CurrentColumnName” flow variable instead of using a static column name. Just replace whatever column name you operated on before by this - double-click it in the bottom left of the math node config dialogue to get the syntax right automatically.

Cheers
E

Can you please provide an example of this as I am still getting errors 

Hi
I know a long time has passed since this post and you probably came to the right solution, but because it had not yet reached the solution, I told the post to reply.
First in the old way and using string Manipulation (variable)
second , using String Manipulation (Multi Column) that were added in knime 4.2
example Workflow for you: :blush:
string manipulation multi columns.knwf (23.6 KB)
best
sajjad

3 Likes

Hello @Sajjadmosaheb,

tnx for sharing your solution. Did you know you can use KNIME Hub as well for sharing your workflow, ideas and solutions?

Also see here how you can make your workflow executable when others download it by using workflow relative paths:

Last advice: reviving old topics is not popular :wink:

Br,
Ivan

2 Likes

Hello @ipazin,
Thank you very much for your advice
Yes, I will definitely use the hub
I usually use relative path, I do not know why I forgot this time,
To be honest, I did not pay attention to the post time at first,
And because it was in uread posts, this post came up for me, I think the old posts that have been answered should no longer be seen above :wink:
best
sajjad

2 Likes