@Tanzill_Ahsan
requested code is a LINQ statement but not regex
Group the data from input by the reference and the currency
if the group has more then 1 members add a counter on the reference
add the result to outDT
it coulld look like
123 $
123 $
124 $
123 €
out:
123.1
123.2
124
123
in case of you would like to run this statement we would suggest to simplify it as well