Hi there,
I’m trying to delete the duplicate rows.
while using ‘remove duplicate rows’ remains the single original rows…
I want to delete that original rows too… if it is duplicated.
For Example.
Column A contains { 1, 1, 1, 1, 1, 1, 11, 11, 111 } then output should only { 111 }
Yoichi
(Yoichi)
November 21, 2022, 7:41am
2
Hi,
Can you try the following expression?
dt.AsEnumerable.GroupBy(Function(r) r("Column A").ToString).Where(Function(g) g.Count=1).SelectMany(Function(g) g).CopyToDataTable
The above check duplicated value of ColumnA.
Regards,
1 Like
Gokul001
(Gokul Balaji)
November 21, 2022, 7:45am
3
HI @Peace_Maker
How about this expression?
(From d In Dt1.AsEnumerable
Group d By k=d("Column A").toString.Trim Into grp=Group
Where grp.Count = 1
From g In grp
Order By Dt1.Rows.IndexOf(g)
Select r=g).CopyToDataTable
Check out the XAML file
DuplicateRemove.xaml (7.3 KB)
Regards
Gokul
1 Like
Thank you!
your code is work fine too~~
1 Like
system
(system)
Closed
November 24, 2022, 7:57am
6
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.