How can i remove the duplicates

Hi team,

100,123
100,123,124
100,123,124,125
100,123,124,125,126
110,120
110,120,129
110,120,129,130

Like wise many numbers are there dynamically
i need output should be 100,123,124,125,126 and 110,120,129,130 and etc…

How can i do this. i am just using for each row inside for each row with input datatable and i am finding the duplicates then printing but it looks like this i need the last line of the duplicates.

Could you guys please advise me on this.

Regards,
Sriram

Hi @Sriram07,

hope this expression would help you resolve this
yourdatatablename = yourdatatablename.AsEnumerable().Groupby(Function(a) a.Field(Of String)(“yourcolumnname”).ToString).Select(Function(b) b.Last()).CopyToDatatable()

edit: not sure this will work because i doubt whether duplicates with extra value around will also be considered in group by…lets try
Cheers @Sriram07

Sequence1.xaml (8.8 KB)
Check the file and make changes accordingly

2 Likes

Hi @ImPratham45

How to write into excel file from A1,A2,A3… or A1,B1,C1 ?

Thanks you :slight_smile:

@Palaniyappan

Could you please tell me what is the actual purpose of

? Like for each??

Not exactly

But it’s like enumerating…going one by one in individual
Cheers @Sriram07

1 Like

the data is in list so by iterating it you can write them into excel cell as you mentioned

1 Like