Use Replace in Datatable


Please I need your help, I extracted data by using data scraping, then I write it in excel file before I do this I need search in one column for any value contains " - " with one space after the dash and replace it with " - " with two space after the dash.

Example: If I find “Jeddah - 123” I want to replace it to “Jeddah - 123”

Hi @aalaghbari

You can use string Operation by using assign and replace it .

But can you be more specific as the example you gave doesn’t show any difference.

Example: If I find “Jeddah - 123” (Here there is only one space between the dash and 123) I want to replace it to be “Jeddah - 123” (two space between the dash and 123).

I will write another example to be clear.

If I find “Test AB 123”,“Test2 AB 123”,“Test3 AB 123”,…etc I want to replace “AB” to “CD” in all value.

You can use For Each Row to iterate row. in For each row,
Assign row.item(“Column”) = row.item(“Column”).Tostring.Replace(“AB”, “CD”)

Thanks a lot for your help.

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