1

I found there are hundreds of cases of duplicated citation keys in one of my bib file. It seems generated by Mendeley but I'd rather believe it was me who made such mistake (I didnt remember I ever copied another bib file into this one, though). Anyway, now my problem is how to assign different citation keys to the enties sharing the same key (they are different articles). Doing this manually would be a bit time-consuming though could be fun if I try to make it ;). Is there some way by which this job can be done in one stroke? or I need to compose a Python script for this task?

9
  • JabRef has the functionality to cycle through duplicates (from reading the documentation).
    – Werner
    Commented Oct 20, 2020 at 23:11
  • 2
    Effectively, JabRef can make unique keys for all the database with just one click. The problem is only if you also have some text citing these references, that in some cases will point to the wrong key an in others to the lost key, and there are no programs to solve this.
    – Fran
    Commented Oct 21, 2020 at 5:45
  • 2
  • Finding duplicate cite keys should be fairly straightforward, but then you still need to decide if the two entries are the same or different (I wouldn't want to assume that they are always different). In a second step you may also want a feature to find duplicate entries. That is much harder. I've heard that JabRef does very good things at that front as well, but I'd expect it's possible that automated solutions simply don't catch everything. In the end you may also need to worry about changed entry keys if you have old documents that you want to use with your new .bib file.
    – moewe
    Commented Oct 21, 2020 at 6:22
  • 1
    Does this answer your question? Cleaning up a .bib file
    – Elad Den
    Commented Oct 21, 2020 at 7:11

1 Answer 1

0

Found the solution. You need to install the BBT plug-in on Zotero first. Then, a. Import the bib file into Zotero. b. Select all. Right click and select Better Bib TeX – Pin Bib TeX key. The BBT will automatically regenerate ALL citation keys - the previous ones will all be discarded. c. Export to a new bib file. The regenerated keys are pretty long, for example, "accessDrivingSaferGreenera". But it is ok for me. At least I dont need to set the duplicated keys one by one...

2
  • Import, export and odd bibkeys. All of this is can be avoided with JabRef, and as I explaned above, Jabref can make all the keys at once, not one by one, and moverover, you can specify the desired pattern for the auto generation of the bibkeys. You should take a closer look to this program.
    – Fran
    Commented Oct 22, 2020 at 8:34
  • Agree with @Fran this is the best bibliography management software that is free and plays well with Latex Lyx and family. The only caveat its java so some enterprise systems do not allow installation of this. It also has ability to search and add from Medline/Pubmed/DOI. Commented Nov 15, 2021 at 19:14

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .