9393
(JSJS)
June 8, 2022, 12:14am
1
Hello.
Compare two data tables
I want to extract data that is not the same.
If you know how,
I ask for your help.
How many columns do you want to compare? Or all the columns?
If you compare two columns only, you can use activity “Join Data Tables” to check the difference and similarity. You may have to compare columns individually if you want to compare the whole datatable.
9393
(JSJS)
June 8, 2022, 12:33am
3
I’d like to compare all the columns
Yoichi
(Yoichi)
June 8, 2022, 1:30am
4
Hi,
The following will help you.
arrDr = dt2.AsEnumerable.Except(dt1.AsEnumerable,DataRowComparer.Default).ToArray
arrDr is DataRow[] type.
Regards,
9393
(JSJS)
June 8, 2022, 2:04am
5
Thanks,
Let me ask you one more question.
Only values that are not the same
Is there a way to extract it?
Ex) 3,3,3,4,4,4,5,5,5
Yoichi
(Yoichi)
June 8, 2022, 2:06am
6
Hi,
Only values that are not the same
Is there a way to extract it?
Can you elaborate?
Is “3,3,3,4,4,4,5,5,5” expected output?
Regards,
9393
(JSJS)
June 8, 2022, 2:09am
7
After comparing the two data tables,
You must find a location for an unequal value.
so
I want to extract only the values that are not the same, is it possible?
On the Excel screen that I uploaded as an example,
The price I want is
I want to extract only the separate values of 3, 3, 4, 4, 5, 5.
Yoichi
(Yoichi)
June 8, 2022, 2:13am
8
Hi,
How about the following expression?
String.Join(",",dtResult.AsEnumerable.SelectMany(Function(r) r.ItemArray))
Regards,
9393
(JSJS)
June 8, 2022, 3:26am
9
Thank you.
I want to use Uipath freely like you, so what kind of study should I do?
Yoichi
(Yoichi)
June 8, 2022, 3:34am
10
Hi,
I think it’s better to learn by UiPath Academy, first. However, the above expression is technique of VB.net rather than UiPath. So, next learn VB.net or C# deeper. The following topic might also help you.
LINQ is part of the .NET framework and offers capabilities for interacting with data, objects or other sources within a particular syntax.
This HowTo introduces on starting with LINQ (Language-Integrated Query).
Current Version of this topic is DRAFT and will be finalized / enhanced soon
Introduction
Typical tasks for implementing parts of an automation project are interacting with e.g. with data in a datatable or items from collections. LINQ can help to implement it into a compact and standa…
Regards,