Automation of removing duplicates, adding the tag of the removed duplicated to the one that remains (HELP)

Dear all,

In short, I have 100 000 duplicated references each associated with a different tag and my goal is to add to the reference I want to keep the tag of the one I’m deleting so that, in the end, I have one reference with two or more tags.

Example: Duplicated X (tag: 1.1), Duplicated Y (tag 3.2). Here, I go to “Manage tags” and add to Duplicated X the tag from his duplicated (Duplicated Y), in the end I’ll have: Duplicated X (tags: 1.1 & 3.2). I’ll add a screenshot to show you visually how this process is done.

Is there any possible way to automate this process? It will take me forever. I thought about Python but my knowledge is very limitated, I would really appreciate help in this matter.

Even if I spend all my day doing this it will be very difficult to do it on time.

Thank you, I look forward to your help.