Regular expression for removing text

Dear all,

I would like to remove the unnecessary letter and change the type from Text to Number.

Could you please let me how to do it?
(TEXT) 1,709(0.45%) → (Number) 1709

image

thanks,
Best regards,

Hi,

Can you try the following?

Int32.Parse(System.Text.RegularExpressions.Regex.Match(yourString,"^[\d,]+").Value.Replace(",",""))

Regards,

1 Like

Hi @Printf7

You can make the changes to all the rows of datatable at once by using below code in invoke code activity

 dt1.AsEnumerable().ToList().ForEach(Sub(row) row("Pageviews")=System.Text.RegularExpressions.Regex.Replace(row("Pageviews").ToString,"\(.*\)|,",""))

Regards,

Nived N

Happy Automation

2 Likes

Hello,

It works well! Thank you so much!!

1 Like

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