aishwarya1
(Aishwarya)
September 12, 2021, 8:55am
1
Hi,
I have 2 excel sheets, one with 4 rows and other with 6 rows, I want to get all the rows from sheet1 and the not matching extra rows from sheet2 and paste the combination of both in sheet3.
please assist in how to achieve this scenario… thank you so much in advance.
lakshman
(Ganta lakshman)
September 12, 2021, 9:50am
2
@aishwarya1
Welcome to our UiPath community.
Use Join DataTable activity to do this.
Have a look below thread.
Dear innovator’s,
All we know that there is a Join Data table activity in UiPath.If we get any matching scenarios with unique value will approach join data table activity instead of filter/loop/array matching activity to find an exact match.
Join Data Table:
[image]
Combines rows from two tables by using values common to each other, according to a Join rule, which is specified in the Join Type property.
Sample Table:
[image]
INNER Join:
The INNER JOIN keyword selects records that have m…
Hi @aishwarya1
Welcome to forum
For your question i am assuming that
dt1- datatable after reading sheet1
dt2- after reading sheet2
Now to get uncommon rows from dt2 use the below linq
dt_uncommon= dt1.AsEnumerable().Except(dt2.AsEnumerable(),System.Data.DataRowComparer.Default).CopyToDataTable**
now append the dt1 and dt_uncommon in same excel sheet using append range or merge datatable activity
Regards,
Nived N
1 Like
aishwarya1
(Aishwarya)
September 12, 2021, 10:38am
4
Is there a way to compare only one column between the datatables?
aishwarya1
(Aishwarya)
September 12, 2021, 10:56am
7
I want the output as below
Please assist
Hi @aishwarya1
u can try this
assume
dt1 —> sheet1
dt2 -----> sheet2
dt3_uncommon= (From r1 in dt2.AsEnumerable
Where dt1.AsEnumerable().Where(Function(row) row(“Organization Name”).ToString.Trim.Equals(r1(“Organization Name”).ToString)).Count=0
Select r1).CopyToDataTable
Now use append range or merge datatable to merge the dt1 and dt3_uncommon to a excel sheet.
Regards,
Nived N
3 Likes
system
(system)
Closed
September 15, 2021, 11:07am
9
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.