Read Excel A value, Search in Excel B and Difference store in C

Hi Team UI,

I am learning UiPath and want create a robot for below case study and need your expert assistance to it please:

Explanation: I have 2 excel files A & B. need to pick a column cell value from A, find it in another excel B; if found, place its respective row to a new sheet C (Need to perform this to a sheet of more than 1000 records)

Case A: Create New Excel C.1. for all searched A cell value found in B
Case B: Create New Excel C.2. for all searched B cell value found in A
Case C: Create New Excel C.3. that are not found in A and B

Any assistance would be appreciated :slight_smile:

Hi ,

This seems like a standard query issue.
You need a left join of A and B, a right join and an inverse inner join.

There are already posts on doing a query on excel sheets on this forum

thanks for prompt response, i basically need to compare the 2 files but only specific column values and not row wise

This might give you the solution
Please implement the below code if you are satisfied with the result or else please let us know.

Please find the attached file for your reference and let us know if it (17.3 KB)

Pavan H.

1 Like

Thank you Pavan for your kind response, trying it right away…

Dear Pavan,

the code has a part of if -> Then, that creates the common values,
if i need the Uncommon value, what code/logic shall i include in the Else that creates another sheet with only missing row amongst the 2 sheets?

thank you in advance

Create new data table using build datatable activity as similar to one in the workflow that is uploaded, add a add data row activity in else block and store to the newly built datatable and write to excel sheet using write range activty,
This will help you add unmatched vales to other sheet,
Hope this helps you jn solving the issue, please let us know if this is your solution

Pavan H

1 Like

Hi Pavan, thank you again for you time and inputs

May I request you to share the solution with updated Else please

I tried but unfortunately it didn’t work, I am sure I am doing something wrong in the Add row and not creating a new DataTable

Thanks in advance, your help would be highly appreciated

Step 1

Hi Instead of using 2 for loops use one for loop and use select query inside for loop in if condition and then use add data row activity to write to datatable,

Please refer the below xaml file for your reference and sorry for late response, thank you for your patience.

Test.xaml (13.0 KB)