Removing duplicates by comparing Excel sheets

Hi all, my doubt is there are two Excel files like previous file and present file i want to compare the files and remove the same data present in previous file in present file can any body provide the solution

Hi @Harsha_Vardhan8

Use Remove Dupicates Activity under excel process scope in Modern Experience.

Check out this below thread too

It may help you.

  1. Use the “For Each Row” activity to loop through each row in dtPreviousFile.
  2. Inside the loop, use the “For Each Row” activity again to loop through each row in dtPresentFile.
  3. Use an “If” condition to compare the data in the current rows from both data tables. You can use the column values or any unique identifier for comparison.
  4. If the data in the current rows of both data tables matches, use the “Remove Data Row” activity to remove the row from dtPresentFile.
  5. After both loops, you will have dtPresentFile with the same data as the present file but with the data that was in the previous file removed.


Hi @Harsha_Vardhan8

Use this linq query:

filteredRows = dt1.AsEnumerable().Where(Function(row) Not dt2.AsEnumerable().Any(Function(prevRow) prevRow(commonColumn).ToString() = row(commonColumn).ToString())).CopyToDataTable()