How to compare two excels in uipath?

activities
studio
#1

Hi Guys,

i have two excels .in first excel i have id, name and pan id and second excel has id,name and pan id
if the employee matches in both the excels…the out put - in first excel sheet1, in column 4 it should return as a matched profile with the green color and else it should return as a non matched profile with red color.

Can anyone of you help me here ,how to do this task.

Thanks in Advance,

0 Likes

#2

Read both excels with Read Range, once you have them in separate DataTable apply foreach for datatable and get row item name and if name matches use write range to write in excel sheet

2 Likes

#3

hey…i have tried the same way.But no luck :frowning:

0 Likes

#4

Hello,

Initially, you need to identify unique value(For example pan id or id is unique). You have to compare pan id from excel 1 and pan id from excel 2.

Procedure:

1)Read Excel 1
2)Read Excel 2
3)For each row in a data table
4)Get row item (Pan id) (1st excel) (You will be getting each row in pan id column)(Stored in a variable)
5)Get row item (Pan id)(1st Excel) (You will be getting each row in pan id column)(Stored in a variable)

Compare 2 variables using if
Write range into Excel

0 Likes

. For ex. in excel A , i have ZXRC=1, in excel B wherever i find ZXRC, i have to update 1 in next column.... its like UPDATE query in SQL...how to proceed
#5

See attached workflow, ExcelSheet2 would have the result once you run it -

Main.xaml (17.9 KB)

ExcelSheet1.xlsx (8.5 KB)
ExcelSheet2.xlsx (8.5 KB)

1 Like

#6

Hi,

I have to compare Data from two separate sheets of same Excel columns and write the status as pass or fail in first sheet.but,iam unable to do it,since iam new to ui path.please,provide me solution.

thanks.

0 Likes

#7

One of my friend “Anmol” helped me to find out the difference and create an excel with diff. Use the attached
He has used the below “DataTable2.AsEnumerable().Where(function(row) Not DataTable1.AsEnumerable().Select(function® r.Field(Of String)(“Temp”)).Any(function(x) x = row.Field(Of String)(“Temp”))).CopyToDataTable()”
AccuWeather.zip (26.5 KB)

0 Likes

#8

hey how to use this code to compare DOUBLE values. Where should I put the convert.todouble?
When used the below code getting castin error. Can you please help?

DataTable2.AsEnumerable().Where(function(row) Not DataTable1.AsEnumerable().Select(function® r.Field(Of double)(“Temp”)).Any(function(x) x = row.Field(Of Double)(“Temp”))).CopyToDataTable()

0 Likes