Replace a string with another string from the entire data table

Hi team

I want to replace a particular string from the entire data table, so how can I do it?

thankyou :slight_smile:

Hi @Aishwarya_Bhargava

We can achieve it through LINQ!

Refer the thread below!

Regards

This is giving me error

Hi @Aishwarya_Bhargava

Can We have a expected Output Screenshot??

Read range the excel !

Create Datatable Variable.

Assign:DtVariable= readDT.clone

Use the Below LINQ Function!

assign activity:
left side dtCorrected (datatype: Datatable)
rigth side:
(From d in ReadDt.AsEnumerable()
let ra = d.ItemArray.Select(Function (x) x.toString.Replace(“YourValue”, ”ReplaceValue”)).toArray
Select rc = DtVariable .Rows.Add(ra)).CopyToDataTable

Cheers
@Aishwarya_Bhargava

first 2 rows are input and second 2 are output

it worked
thankyou :slight_smile:

@pravin_calvin
i want to replace multiple strings with other multiple strings
so how can I do that in a single take

Hi @Aishwarya_Bhargava

Can we have a sample input and output ScreenShot?

Whether you need to replace in one column Value or Multiple Value Column!

Regards

Hey @Aishwarya_Bhargava

Check if following this steps helps you

  1. Read data table
  2. Use output data table activity this convert data table to string
  3. Use assign to replace the text you want to replace
  4. User Generate data table activity to generate data table from string variable
  5. Write the data table back to excel file

Let me know if you face any issues in this.

2 Likes

the generate data table is giving me all the columns in a single row, how can I fix it

Can you share the workflow here if possible? @Aishwarya_Bhargava

i can but it has variables attached to the configuration file
so I am not sure how it will be useful
Automatic.xaml (21.8 KB)

1 Like

In Column Separator of Generate Data Table I see you have used comma did you try changing it some other options and see if it is working as expected?

Also, keep this option checked and see if it works @Aishwarya_Bhargava
image

1 Like

it worked thankyou :slight_smile:

Awesome @Aishwarya_Bhargava

1 Like

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