Please help to compare excel files

Dear Masters of Ui World.
i am new to UiPath and new to company.
i am stuck at some point which i need help.

  1. I have excel A and excel B and output file with pre-defined headers.
  2. i need to compare both the excel for exact Match (Excel-A will be the base file) and excel B is the comparison file.
  3. matching to be done with column c (Number)
  4. post match i need to put the matching info in output file.

please help on this Excel A.xlsx (9.8 KB) Excel B.xlsx (9.6 KB) output.xlsx (9.2 KB)

Hi @Sonia_012,

You can use Join DataTable activity to join @ column C column by doing Inner join. Which gives you exact result in output datatable.

PS- Use read ranage of 2 file and then use Join DataTable activity

1 Like

ok let me try

1 Like

not able to get the proper output


Can you please share us the workflow?

Hi Sonia,

You can use Join DataTable activity and choose Inner join , it will give you common rows from two datatable.

join datatable.xaml (8.9 KB)
here find the workflow please mark as solution :blush:

Aleem Khan
Happy Automation

Hi Aleem, thank you for the solution, one query if the output file has predefined headers. how bot will understand in which column BOT should write number and which column it should write SL.NO. please help output.xlsx (9.2 KB)

Hi Sahil, yes but my output file does not have fix column as per the source files .

output.xlsx (9.2 KB)

i cant share the workflow as this is company desktop

Hi @Sonia_012 ,

Okay, No issues…

I think, now you are able to join the data and get the common data of it…

Now, the issue is we want to write data in the respective column of output excel file rgt?

If that, the case, what you can do is. you can use read range to read output excel file-> for each row activity → inside that use “add data row” to output data table in whichever format you want…

like ->in arrayrow property in addDataRow, you can use the expression like this…

Let me know if I am wrong in understanding your scenario…

1 Like

yes your understanding is correct trying that now…

as per you scenario use nested for each row and compare the value then if that value found use add data row activity in array

m getting error add data row object reference not set to an instance of an object

can you incorporate in the existing xml file which you have shared. it will be really helpfull.
thank you in advance

Hi @Sonia_012 ,

As per your requirement, i have built the workflow. Can you please look into it and let me know, if it works…

PS- Remove the 1st read range in workflow and for each row activity use JoinDataTable Variable in your workflow and reuse and implement the same approch in your workflow.

It works!! (33.9 KB)

Match two excel and paste match record in output table.xaml (16.0 KB)
please go though workflow i hope this complete you requirement please mark as solution :slight_smile:

1 Like

Thank you so much :smiling_face_with_three_hearts:

1 Like

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