Everyday I have to export current day excel from portal and have to check “Case” in yesterday excel file, if case found then delete that record from current day excel file.
This is the query. Attaching sample excel files.
Please help 04112024.xlsx (8.6 KB) 01112024.xlsx (6.0 KB)
Use Excel Application Scope activities to read the two DataTables (DataTable1 and DataTable2) using Read Range activities.
Use LINQ to Find Matching Rows:
matchingRows = (From row1 In DataTable1.AsEnumerable()
Join row2 In DataTable2.AsEnumerable()
On row1(“ColumnName1”) Equals row2(“ColumnName1”) And row1(“ColumnName2”) Equals row2(“ColumnName2”)
Select row1).ToList()
Replace “ColumnName1” and “ColumnName2” with the actual column names you are using.
Remove Matching Rows:
Use a For Each activity to loop through the matchingRows list and remove each row from DataTable1.
For Each row In matchingRows
DataTable1.Rows.Remove(row)
Next