Save key mapping when merging or detecting duplicates

When merging one bibliography into another, or detecting duplicates, it would be very useful to somehow save/export a mapping from the old entries’ keys to the target entry’s key.

E.g. my main bib file contains an entry
@article{authorFooBar2019,...}
and the bib file I am merging into the main file contains
@article{author_foo_bar_baz_2019,...}
Jabref correctly detects the duplicate and I decide to merge them together into the main file’s entry, keeping the key authorFooBar2019. So far so good. But now let’s assume that I already have a latex document with references with the old keys, e.g. one to author_foo_bar_baz_2019. Now I have to manually write down, during the merge process, which key changes into which so I can find-replace the old keys in my latex files.
Is there a way to export a mapping of keys during this merge process? E.g. into a text file with one line for each key replacement like so
author_foo_bar_baz_2019,authorFooBar2019
Then I could convert this list into a sed command to automatically find-replace the old references.

Hi,

JabRef currently does not write a log file of merged entries, but it could be easily expanded to do so.
I would suggest you open a new issue at the github repo about that.


Codewise the Merge entries feature is handled in this class where the left and right entries are given as inout.

Btw,

So far so good. But now let’s assume that I already have a latex document with references with the old keys, e.g. one to author_foo_bar_baz_2019 . Now I have to manually write down, during the merge process, which key changes into which so I can find-replace the old keys in my latex files.

You might be also interested in the new LaTeX integration feature which @davidemdot is currently developing during GSOC. I think this could be an interesting use case as well.

I follow this post to see whether there is a solution for merging entries.

I always have headache when I merge duplicated entries, especially the keys are both used in tex files.
If the combination relationship can be printed, it is easy for users to replace the keys in tex files.