I mean to delete rows from data table that exist in another data table. Match & delete
there is no such primary key for any of the record in both data table.
Hey @sauvaish
If i’m right, you are comparing two datatables and need to delete the identical rows from one datatable, for this you can use Remove Data Row activity by passing the datarow object in the property.
Thanks,
Goutham Vijay
Hi Goutham,
Thanks for Replying!!
Actually i want to delete row from Test.csv that exactly matches Test1.csv row.
Test.zip (319 Bytes)
Test1.zip (248 Bytes)
Thanks
Saumya
.
Hi @sauvaish
Your files(csv) doesn’t have column headers. While comparing both, first we should see the count of column headers.
Thanks,
Hi Goutham,
Can u please elaborate.
Buddy @sauvaish
Welcome to UiPath Community buddy and thats really a good question to start with
Its resolved buddy
Here you go, run the xaml buddy
Test.zip (11.8 KB)
Kindly try this and let know buddy
Cheers
hi @sauvaish
you can achieve this using linq
Find the attachment below,
Unmatched.zip (11.4 KB)
dataTable 1
dataTable 2
here you can see highlighted records are matching,
and here’s the output with unmatched records
hope this will help you.
Thanks @Palaniyappan
Done!!
Thanks @samir.
Thats great…
Kindly make a comment marked solution buddy @sauvaish
Cheers
Keep going
This query works for A column only…
how do I match the whole row?
Hi!
Is there a way to make this skip error if datatable A has no data in it? I have repetive function which has the datatable A empty every now and then. This causes it to have error.
Welcome to our UiPath Forum!
I’d suggest adding a simple IF condition and only process the data if there is something in there. It could be something like:
dtVar.Rows.Count > 0
This will return true if there are rows and false for no a dtVar with no rows.