I have 2 excel , excel 1 Ac no and Ab no and excel 2 have same Ac no and Ab no , if excel 1 Ac no and Ab no both number found in excel 2 i need to skip else i want append excel 1 to excel 2
excel 1
excel2
Expected output:
No need to append why because excel1 5555 6666 those number found in excel2 if not found those no i want to append.
Combination of number(“Ac no” and “Ab no”) to find duplicate based on the count if count =0 i should append else skip
Read the first excel in to dt1 and second into dt2
dt1.AsEnumerable.Except(dt2.AsEnumerable,DataRowComparer.Default).CopyToDataTable - this will give the rows which are not present in dt2 but present in dt1
First step I am reading both the datatables using read range
in the second step we are using assign activity to create a new datatable which has the rows from dt1 but no matching rows from dt2 are to be present…for that we are leveraging except method to remove the matching records
Append all the obtained data from step2 which is basically the unmatched data into the excel 2 as needed
You can as well use this linq in the second step
dt1.AsEnumerable.Where(function(x) Not dt2.AsEnumerable.Any(function(y) y("Col1").ToString.Equals(x("Col1").ToString) And y("Col2").ToString.Equals(x("Col2").ToString))).CopyToDataTable