Excel compare 2 Column

Hi All…

I have a 2 excel sheet which is look like I have shared an image below. so, I have to compare 1st column from the 1st sheet and 1st column from the 2nd sheet. if it’s matched, I have to get the value from the 2nd column from 1st sheet and past it to the 3rd column to the 1st sheet. if it’s doesn’t match the value should be blank. (I have attached the image for reference. please find that)

I have to use linq because of huge data.

TIA!..:slight_smile:

Hi @soundarya.a ,

have you tried using “Join datatable” activity ?

Here is Link (if in case you want to learn more about it ) : https://docs.uipath.com/activities/docs/join-data-tables

For your scenario, you can use LEFT JOIN as shown below
DT 1 : Once you perform Read range of Sheet1, call the datatable as “DT1”
DT2 : Once you perform Read range of Sheet2, call the datatable as “DT2”
DT3: output data

Hope this help!

Hi @soundarya.a

Make dictionary of the 2nd Data Table with key as the first column and value can be anything

Use ContainsKey method to check if the Name is present or Not

image

Refer the xaml file

LINQ_DT_ComparisonWithDictApproach.xaml (11.6 KB)

It is based on the approach by @ppr

Thanks a lot. but i have to use only linq for both DT. if i use For each activity it will take a lot of time. because the sheet has around 20k data

Thanks.
yeah, I used this, but it takes too much time as well

Hi @soundarya.a

It won’t take time. Try it

Hi @kumar.varun2
I have to use write range where do i have to use and which Dt have use in that.

The data table is dt1

image

Hi @kumar.varun2
It worked. Thank you So much.:slight_smile:

1 Like

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