Find duplicate number in regex

Hello guys, here is my extracted data with regex
image
i need to get only one duplicate which is 4500043209 is it possible?
thank you !

Hi @Aluneth_X,
Output of regex is IEnumerable type so you can use For Each to write down each element to table for example. Then you can sort the table and compare each element to the next one. If they are similar, remove element.

Hello guys, so here is the extracted data from regex
image
the regex pattern is “45000\d+”

now i need only one value frrom duplicate number which is 4500043690
so the output should be only 4500043690
any help would be apreciated
thank you

Hi,
this https://stackoverflow.com/questions/1573361/how-do-i-find-and-remove-duplicate-lines-from-a-file-using-regular-expressions maybe helps you

Cheers

Sort the numbers, replace comma with space and use this regexp as example https://regex101.com/r/zHU2iE/1

@Aluneth_X,
Please don’t double post about the same case. You can just update your first one.

Hello @Aluneth_X
You can use this pattern “\b(\w+)\s+\1\b” as suggested by @c.ciprian
but this will only work if the repeated value comes next to the original value
Use this code in an assign activity it’ll get all the duplicate value regardless of its position

Output.GroupBy(Function(r) r.Value).Where(Function(g) g.Count>1).Select(Function(r) r.Key)

Check this workflow for better understanding
GroupByDuplicateValues.xaml (8.2 KB)

2 Likes

thank u good sir

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.

Sign Up Log In