3

How does one identify the unique bibliographic entries in a pair of substantially overlapping bibtex bibliography files?

For instance, suppose bib file a.bib has the following entries:

    @article{red
            ...}
    @article{blue
            ...}
    @article{green
            ...}

And bib file b.bib has the following entries

    @article{green
            ...}
    @article{red
            ...}
    @article{yellow
            ...}

How might I quickly extract bib entries blue (unique to a.bib) and yellow (unique to b.bib)?

  • An interesting question. Just to clarify, aren't these the citation keys rather than specific entries? I.e. there's a possibility that green in a.bib is not the same as green in b.bib. I have a similar problem, in that the entries may be the same in two files, but the keys could well be different, which is why I ask this question about the citation keys. Checking that two entries are the same seems to involve a bit more complexity. – Iterator Jun 24 '12 at 21:26
  • Since you have some responses below that seem to answer your question, please consider marking one of them as ‘Accepted’ by clicking on the tickmark below their vote count (see How do you accept an answer?). This shows which answer helped you most, and it assigns reputation points to the author of the answer (and to you!). It's part of this site's idea to identify good questions and answers through upvotes and acceptance of answers. – user36296 Jul 27 '18 at 19:15
4

There are probably any number of tools that can perform this task.

One of the better-known BibTeX toolkits for users of Unix platforms is Nelson Beebe's set of "BibTeX bibliography tools" -- see http://www.math.utah.edu/~beebe/software/bibtex-bibliography-tools.html. Among these is a tool called "bibjoin", which is probably (very close) to what you're looking for. The converse of merging two bib files (i.e., taking their (nonoverlapping) union is to find the parts of a.bib and b.bib that aren't in the intersection of the two sets.

Another such tool is "Bibi, the BibTeX Manager" available at http://bibi.sourceforge.net/. Among its advertised features is "Merge two bib files".

For MacOSX users, "BibDesk" -- see http://bibdesk.sourceforge.net/ for more details -- may be of special interest for the task at hand.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.