Remove all commas from datatable

Hello everyone,

I am using a read range activity an excel file that I get from someone at work. My automation will upload that file to another program.
That excel table contains many columns with numbers and if the numbers contain commas(,) then the upload will fail.
Normally I would use “For Each Row” to check for commas and remove them but since there are many columns to check, I was wondering if there is a better solution to remove all the commas from the datatable.

Thank you.

@dvn - Please check this post…

1 Like

Hi @dvn

You can try this way too

Use this code to use in invoke code activitiy with dt1 as in/out argument

dt1.AsEnumerable().ToList().ForEach(Sub(row) row.ItemArray.ToList().ForEach(Sub(e) e.ToString.Trim.Replace(“,”,“”)))

let me know if it works for you

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

1 Like