Look for corresponding value in row in Excel files

I have two Excel files. For each row in Excel file 1 I would like the bot to find the first match same row in Excel file 2 then delete that row

Unsure how to do this - The methods I have tried remove more than one row match which is not what I want, I would like the first match only to be removed

Cheers

Hi @E.T.S

Follow the below process -
→ Use the Use excel file activity and give the path of Excel1.
→ Insert second Use excel file activity and give the path of Excel2.
→ Inside second Use excel file, Insert for each excel row activity to iterate the rows in the Excel1.
→ Inside for each insert second for each excel row activity to iterate the rows in the Excel2.
→ Inside second for each insert If condition to check the condition.

- Condition -> CurrentRow1("Column name in Excel1").equals(CurrentRow2("Column name in Excel2"))

→ Inside then block insert the Delete row activity and give the CurrentRow2 init.
→ After Delete row activity insert the Break activity to break the loop after deleting the first match.

Hope it helps!!

1 Like

Instead of doing the multiple loops, If you give the Input files we will give you LinQ Expression… @E.T.S

This worked! I wanted to avoid using a nested for each however the break activity did exactly what I needed thanks!

1 Like

It’s my pleasure… @E.T.S

Happy Automation!!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.