View Single Post
Old 05-30-2011, 01:45 AM   #13
ctwaley
Junior Member
ctwaley began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2011
Device: Nook
Quote:
Originally Posted by Starson17 View Post
...This will also do it:

Code:
calibre-debug -c "from calibre.library.database2 import LibraryDatabase2; db = LibraryDatabase2('/path/to/library/folder');dupes = db.conn.get('select title from books group by title having count(*) > 1;');print dupes;">dupes.txt
Copy that long line, change the path to point to your library folder and paste it into a command window (terminal window, dos box, whatever you call it) and it will produce a file in the current directory called dupes.txt with all your duplicate titles in it. It's a list of dupe titles in unicode format.
Hi ppl, new kid on the block here.

FWIW: judging from the command line code Starson17 has shown, it looks like it would work well in a 'nix environment, but for the windows users this would be more appropriate. Create a batch file using the following code:
Code:
@echo off

"%PROGRAMFILES%\Calibre2\calibre-debug" -c "from calibre.library.database2 import LibraryDatabase2; db = LibraryDatabase2('X:\Path\To\CalibreLibrary');dupes = db.conn.get('select title from books group by title having count(*) > 1;');print dupes;" > C:\dupe-titles.txt
This will create a comma-delimited "dupes-titles.txt" file of titles (enclosed in square brackets []) in the base of drive C:. Just copy and paste the code into notepad and name it something like "dupe-titles.cmd". Be sure to change "X:\Path\To\CalibreLibrary" to your actual library path.

And for those using a 64-bit Windows machine, substitute "%PROGRAMFILES(X86)%" for the "%PROGRAMFILES%" path. Also be sure to include the quotes I have shown for the "%PROGRAMFILES%" path at the beginning.

---Cole
ctwaley is offline   Reply With Quote