I have a datatable in which for one column there is two name same how to make it as one

I have a datatable in which a colume name has same data i need to make it as single

Name. Age

Sruthe,Dilip,Dilip. 12,30,30

Since in column Name has two dilip and in age two 30 so my output should be

Name. Age

Sruthe,Dilip 12,30

we can get any name or age the output is dynamic

@sruthesanju

Can you share an excel with expected input and output please

Or a screenshot of how datatable looks

Cheers

Hi @sruthesanju

You can use the following function as your objective seems to remove the duplicate row.

image

Hope this helps :slight_smile:

Input DT

Output DT

@sruthesanju

Follow the steps

  1. Use for each row in datatable
  2. Use a for each activity with Enumerable.Range(0,dt.Columns.Count).ToArray() and change type argument to integer
  3. Inside that use assign currentrow(currentitem) = String.Joint(",",currentrow(currentitem).ToString.Split({","},Stringsplitoptions.None).Distinct)

Cheers

Hi @sruthesanju
In UiPath, you can remove duplicate values in a DataTable by using the following steps:

  1. Create a new, empty DataTable with the same columns as the original DataTable.
  2. Use a For Each Row activity to loop through each row in the original DataTable.
  3. Use the condition row(index) = row(index+1).you can continue until the last row value
  4. If the values do not exist, add the current row to the new DataTable.
  5. After the loop, the new DataTable will only contain unique rows.

Regards,
Kaviyarasu N

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