How to remove Duplicate rows with Uppercase and Lower cases letters

in this project I have duplicate data but the data is written in upper case in a few rows and lower case in other rows. So when I run the bot it removes the matching data, but leaves the cases sensitive data in there. Example; in column ADD1 the address is written with upper and lower cases. See pic. dupdata

Here is a screen of the application uipathremove

Hi @jeff.shubzda

You may try adding formula and change all lines to lower or upper case and then run the bot…

Hope bot will remove duplicate lines now…

Hello @jeff.shubzda

Try the below Linq for removing the duplicates:-

dataTable = dataTable.AsEnumerable()
.GroupBy(Function(i) i.Field(Of String)(“Add 1”))
.Select(Function(g) g.First)

Mark as a solution and like it if this helps you :slight_smile:

Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

With groupby as mentioned by Pratik we can handle it, but we have to harmonize it e.g toUpper cases

Assign Activity
left: dtDistinct | DataType: DataTable

(From d in dtData.AsEnumerable
Group d by k=d("Add 1").toString.Trim.ToUpper into grp=Group
Select r = grp.First()).CopyToDataTable

Thanks for the response, I’m new to this stuff, raw like sushi, :slight_smile: how or where do I inject this code within the workflow of my project? Would this be a multiple assign? Sorry for the rawness :slight_smile:

was written above: Assign activity


thank you very much!!! :slight_smile:

Hi @jeff.shubzda

First of all thanks @ppr for highlighting

I just missed the thing to add in my expression in a hurry which Peter highlighted.

The Updated expression is below:-

dt.AsEnumerable().GroupBy(Function(i) i.Field(Of String)(“Add 1”).Trim.ToUpper).Select(Function(g) g.First).CopyToDataTable

I have now just added “.Trim.ToUpper” in the existing expression. That’s it.


Happy Automation :raised_hands:

Best Regards
Er Pratik Wavhal :robot::man_technologist:t4: :computer:

1 Like

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