How to compare two data tables and look for not matching row columns data?

Hi Team ,

In my cases there different column Name in datatable(DT1) need to compare with other data table column in dt2 with different column .
We need to compare the both the datatables if any of the row column data is matched we need to eliminate and non matched row column data need to store in other data table.
But data is more than 7 to 10 Lakhs records.

Need data only if when the row column data is not matched .

Regards ,

Hi @Thumu_Suresh,

Kindly check this article : How to Compare Excel Sheets in UiPath (Full Tutorial) – andersjensenorg

This might help you.

HI @Thumu_Suresh

Checkout this expression

Give a assign activity in that left side DT_Result (Datatable Type)

If you want the rows from dt2 “Column name with Supplier Code”

DT2.AsEnumerable().Where(Function(row) DT1.AsEnumerable().Where(function(r) r("Vendor").ToString.Trim.Equals(row("Supplier code").ToString.Trim)).Any).ToArray.CopyToDatatable

If you want data from dt1 “Column name with Vendor”

DT1.AsEnumerable().Where(Function(row) DT2.AsEnumerable().Where(function(r) r("Supplier code").ToString.Trim.Equals(row("Vendor").ToString.Trim)).Any).ToArray.CopyToDatatable

Hope this helps!


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