How to compare two tables and update

Hi. i want to compare two datatables called dt1 and dt2.

dt1:
name status
berry married
jerry unmarried

dt2:
name status
berry married
jerry married
nimmy unmarried

outputDT:
berry married
jerry married
nimmy unmarried

how to get outputDT using two loops? I already have dt1,dt2

What is the criteria you want to use? Maybe Join DT Activity suits your purpose.

Join the DTs by the name and then loop over to compare the two values.

thanks mate for replying. no i want to update my existing excel file.

@heyBOT
the mentioned join datatable is a good approach to identify differences.

With the following assumption:

  • dt1, dt2 have the same datacolumn structure
  • dt1/2 has no other datacolumns

an alternate can be implemented as well:

  • merge datatables dt2 to dt1
  • remove duplicates