Compare two data tables in different excel files

Hi,
You can try this library package. It takes two datatables as inputs and it compares perfectly and provides 3 datatables as result. First table with matched rows. Second table with Unmatched rows from first Input table. Third table with Unmatched rows from Second Input table. I tried other methods such as looping through each row & each column to compare datatables. But it takes more time to execute.

https://go.uipath.com/component/compare-datatables

This can be easily achieved by using a for each row activity for the first datatable(dt1) and a linq similar to the one below.

//For each row for dt1
dt2.AsEnumerable().Any(Function(x) Convert.ToString(x(“ColumnName”)) = Convert.ToString(row(ColumnName)))

The method “Any” returns a boolean and it can be used to check the condition before throwing the exception in this case.