Print duplicate in the logs if the value is duplicate

I have one .dat file in which there are different duplicate numbers.i want only distinct numbers if values are repeating then print the duplicate with s.no which is in ist column of a file.how to do it in UiPath

@Cuberoot,

How you are reading the data and in which type of variable? is it DataTable?

Thanks,
Ashok :slight_smile:

i am reading data through read text file activity.it is string type
TIA

@Cuberoot,

You can retrieve numbers from string using Regex. Once you have all the numbers, you can put them in array and get distinct from it.

Thanks,
Ashok :slight_smile:

how to do it? Could you pls help me to do it

@Cuberoot,

Share the sample string how it looks.

image
I want only distinct value to execute and if their is duplicate value then it will print the duplicate value in that column.
TIA

@Cuberoot,

Sample output what you are expecting? and input in plain string here please to copy


tia

@Cuberoot,

Here is sample solution

Output:
image

Sample Code:
Text Demo.xaml (15.5 KB)

You are free to customize it as per your need.

Thanks,
Ashok :slight_smile:

what is intIndex=0?
Thanks

@Cuberoot,

It’s iteration index number of the all matching rows of the table for marking first number as processed