Need the row index of a given value if there are multiple intense of it!

Hi All,

I need the row index of a given value if there are multiple intense of it. I don’t want to change my original structure of the data.

for example 4900030673 is repeated twice So, I need the output as {5,11}. We can accomplish this in a For each loop activity. Appreciate any other suggestion

image

Lookup data table activity gives the output of first occurrence. However I need row index of all occurrences!!

Thanks in advance.
Suhas

Hey!

Have a view on this thread…

This could be help you…

Regards,
NaNi

DT.AsEnumerable.GroupBy(Function(r) r(0).ToString).Where(Function(g) g.Count>1).Select(Function(g) g.Select(Function(r) DT.Rows.IndexOf(r))).Toarray

please use lookup table by particular input value and its output is rowindex and cell value
you can easily get resolved

Why do you need other suggestions? Just do it with a For Each. If you are thinking that For Each is slow, that’s a myth. Any method of doing this will require looping. Some methods, like LINQ, simply hide the looping from you but it’s still looping.