Ui Path Comparing Two different Data with possibility of containing same information

Summary:

  1. receive a new data →
  2. compare it with an existing excel →
    if the new data is not in the original excel file:
  3. append the new data only to the original file →
  4. write a seperate new excel file with only the new data. So I can easily do tasks from this file without having to worry about pre-existed data.

Hi guys,

I am struggling to figure out how I can compare two excel sheet.

This is what I want to do:

I have rows of information that I got from a web-page. I have first data-scrapped them into an excel file.
I’m going to have 2 excel files.

One Excel file is a original (base) file which I have written on the cue of the flow.

Another one is a file that I will write on after I receive a database from a website every hour. So this file will be cleared every iteration (1 hour) because I will be appending all the new information in the original (base) excel file anyway. (excluding the ones that is also scrapped during the process)

I have two separate files because I will need to copy only the new information to an app conclusively.

I thought designing it this way will cause less problems in uploading the new data without worrying about also uploading the ones I have uploaded already.

The Problem is I’m having trouble trying to figure out how I can compare these databases.
I need to compare a new datable that I got after an hour with the excel file I have created in the beginning. I have for loops and if statements in it, but I just can’t figure out the condition for the if statement.

This is what I have right now:
If basedata.ToString.Contains(row)

basedata here is a datable variable of the new data scrapped information from the web.
row here is the original excel sheet for-looped

Any Idea why it’s creating a compiler error?
It says I can’t convert String to Integer ( Yes I know that but what is integer here…?)
It also has an error about being a boolean and can’t convert to string.

I think my algorithm might be wrong… any idea how I should structure this?

Hi @seongchan_cho
To compare the datatables u can use linq query’

Check the below link for details

Regards

Nived N

Happy Automation