Today I found a neat solution based on the post by Simon Greenhill. Here's how it works for the citation key:
Voila!
- Locate your Mendeley SQLite Library (~/Library/Application Support/Mendeley Desktop/youremail@www.mendeley.com.sqlite)
- from your terminal type:
sqlite3 your-email-address\@www.mendeley.com.sqlite- Type:
SELECT COUNT(*) as entries, citationkey FROM Documents GROUP BY citationkey HAVING entries > 1;
This basically queries the table "Documents" for all duplicate citation keys.- Then,
DELETE FROM Documents WHERE id NOT IN (SELECT MAX(id) FROM Documents GROUP BY citationkey);
Cite as:
Saad, T. "Deleting duplicate BibTeX entries from Mendeley".
Weblog entry from
Please Make A Note.
https://pleasemakeanote.blogspot.com/2010/06/deleting-duplicate-bibtex-entries-from.html
Nifty trick! For the record, I'm one of the members of the Mendeley QA department, and this post caught my eye.
ReplyDeleteThe fact that we're generating duplicate content for a single citation key in bibtex files sounds like a bug on our behalf and something I'm investigating to further onto our developers. Hopefully, this should be a proper fix within Mendeley Desktop as part of a future release.
Thanks for taking care of that.
ReplyDeleteIn fact, Mendeley seems to keep bibtex entries even after deleting these entries. A fix for that would be most valuable!
Best,
Tony
Yes, a fix for this problem is most urgent. The Mendeley-generated bibtex file is useless if it contains duplicates.
ReplyDeleteFunny about the proposed interim-fix above: after I apply it Mendeley just recovers the database and nothing changes in the bibtex file (although it is re-written).
I have Mendeley (latest stable version) on Ubuntu 9.10.
When I run these sqlite instructions, it finds several duplicates and even a few triplicates. But none of these duplicates/triplicates appear as such in Mendeley itself. But they are still multiplicated in the auto-generated bibtex file.
Anyway, if you do a "Select All" and export a bibtex file manually, you get a bibtex file without any duplicates.
All in all, it seems like the Mendeley team have got some work to do on this issue. I for one do not understand what is going on.
Any news on this, Mr. and Mrs. Mendeley? This "bug" is still prevalent in the current version (0.9.8.1).
ReplyDeleteG.
A partly related issue that keep bugging me is how to insert latex math equations in the title of references in order to for example cite the following correctly? $ is translated to \$ which makes it impossible for latex to understand.
ReplyDeleteCandès, E.J. & Plan, Y., 2009. Near-ideal model selection by $\ell_{1}$ minimization. The Annals of Statistics, 37(5A), pp.2145-2177. Available at: http://projecteuclid.org/euclid.aos/1247663751.
Still not fixed.
ReplyDeleteIt's alive!!!. It seems to work for me. Just what I was looking for.
ReplyDeleteVote for fixing this bug at mendeley feedback forums:
ReplyDeletehttp://feedback.mendeley.com/forums/4941-mendeley-feedback/suggestions/1589255-bug-removing-entries-from-bibtex
This is really making it difficult for me to completely adopt Mendeley. If I'm going to have something manage all of my research, I really need it to produce a decent bibtex file. Any news from the Mendeley end?
ReplyDeleteHi,
ReplyDeleteit seems I found a solution: Delete the documents in the trash! They are also used for bibtex.
Yes, don't forget to delete documents in your trash! It also solved all duplication problems for me.
ReplyDeleteNot a bug, maybe just an undesired feature, or need to make users more aware.
There is also a problem that bitex entries for documents that are both in your library and in one (or more) of your groups are doubled.
ReplyDeleteThe integration/synchronisation of collections and groups leaves a lot to be desired...
Thanks, that trick saved me a lot of time!
ReplyDelete