Discard duplicates but keep attachments from two merged libraries

I have a recurring problem… I needed to merge two large libraries, one on my work computer and one on my home computer. They started off in sync years ago but as I do searches on one or the other they accumuate differences. Every so often I merge. Anyway. I have just imported one file with 65000 references into another with over 55000 references. Both have many references with attachments. Some are duplicate attachments, but in some one of the duplicate set has an attachment but the other does not. The ones with attachments can come from either library.

When I Find Dupicates, I could go through every single reference to discard the one without the attachment, but this would be incredibly time consuming.Is there a way I can make this easier and quicker?

Ideally there would be a tick box saying “Keep reference with attachment” but sadly there isn’t one. Any ideas?It is a lot of duplicate references to go through manually!

What I am doing is Find Duplicates, then sorting the library so all the references with attachments come at the  top, deselecting them so that all attachments are kept, then discarding the remaining highlighted duplicates. This leaves only the duplicated records where at least one of the pair has an attachment as duplicates, all duplicates without attachments having been discarded in the previous step. Then I do another “Find uplicates” and the number to go through to check eah individually is much smaller and the process quicker. But I am alsway woried I might lose attachments and it is still fairly laborious. Is there a better way?

Endnote X9

I take it one library isn’t the one that always has the attachments?  If it were, I would import the one without the attachments, into the one with the attachments, with discard duplicates on?  (added in edit) but I see you said that wasn’t the case… 

Both have attachments to many references, which s why it’s an issue.