Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 02-03-2013, 02:16 AM   #1
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Example of creating a catalog in batch

Hi, I try to create some catalog files with the command line. I have tried several options, try to understand the help options given, but I can't get it work.

What I want to do is the following:

From the tag 'Detectives' create a catalog ''Detective.epub'
(In principle I want this to do for all the tags, I know I can do it manual, but it's each time around 15x the same, I know there must be an easier way)

Can someone give me an example of how this is done with the command line option ?

Thanks in Advance.

Willum
Willum is offline   Reply With Quote
Old 02-03-2013, 02:21 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,436
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
calibredb catalog detective.epub -s "tags:=Detective"
kovidgoyal is offline   Reply With Quote
 
Advertisement
Old 02-03-2013, 02:29 AM   #3
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Kovidgoyal,

Kuddos !!

Thank you.

Willum
Willum is offline   Reply With Quote
Old 02-03-2013, 05:06 AM   #4
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Hi Kovidgoyal,

New challenge:
I have tags with spaces in it... have tried the following:
calibredb catalog detective.epub -s "tags:=Korteverhalenengedichten"
calibredb catalog detective.epub -s "tags:=Korte verhalen en gedichten"
calibredb catalog detective.epub -s tags:="Korteverhalenengedichten"
calibredb catalog detective.epub -s tags:="Korte verhalen en gedichten"
All no luck....
Running out of ideas

Do I have to rename them or is there a way to use that names ?
Willum is offline   Reply With Quote
Old 02-03-2013, 05:07 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,436
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Look at the search expression the GUI uses when you click on the tag and use it in the command line, properly escaping the quotes.

Last edited by kovidgoyal; 02-03-2013 at 05:14 AM.
kovidgoyal is offline   Reply With Quote
Old 02-03-2013, 05:11 AM   #6
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
G:\My Documents\Calibre Bibliotheek>"C:\Program Files (x86)\Calibre2\calibredb" catalog "G:\My Docum
ents\Calibre Bibliotheek\Korte verhalen en gedichten.epub" -s tags:"=Korte verhalen en gedichten"
*** No Section switches specified, enabling all Sections ***
Sections: Authors, Titles, Series, Genres, Recently Added, Descriptions
genre_tags_dict: {u'Detectives': u'detectives', u'Literatuur klassiek': u'literatuurklassiek', u'Sci
ence Fiction': u'sciencefiction', u'Literatuur en romans': u'literatuurenromans', u'Korte verhalen e
n gedichten': u'korteverhalenengedichten', u'Reisverhalen': u'reisverhalen', u'Non-fictie': u'nonHYP
HEN-MINUSfictie', u'Spionage': u'spionage', u'Dictionaries': u'dictionaries', u'Fantasy': u'fantasy'
, u'Jeugdboeken': u'jeugdboeken', u'Thrillers': u'thrillers', u'Reizen': u'reizen', u'Detectives en
thrillers': u'detectivesenthrillers'}
existing thumb cache at C:\Users\Willum Kerker\AppData\Local\calibre-cache\catalog\thumbs.zip, cac
hed_thumb_width: 1.00"
1% Sorting titles
*** No books to catalog.
Check 'Excluded books' rules in E-book options.
***
*** Terminated catalog generation: No books to catalog.
Check 'Excluded books' rules in E-book options.
***

No luck :-(
PS: It works with Dictionaries

Last edited by Willum; 02-03-2013 at 05:14 AM.
Willum is offline   Reply With Quote
Old 02-03-2013, 07:13 AM   #7
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Hi Kovidgoyal,

Did I found a little bug or do I something wrong ?

Regards,
Willum
Willum is offline   Reply With Quote
Old 02-03-2013, 07:17 AM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 26,436
Karma: 5383257
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
You need to figure out how to pass quoted strings in whatever command line interpreter you are using. For bash, it is

-s 'tags:"=Alternate History"'
kovidgoyal is offline   Reply With Quote
Old 02-03-2013, 12:50 PM   #9
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Hi Kovidgoyal,

I couldn't get it work, what I now did.. I have made all the tags 'spaceless'.

Example of catalog.bat:
Code:
@ECHO OFF
Call CreateCatalog "Detectives" 
Call CreateCatalog "DetectivesEnThrillers"
Call CreateCatalog "Dictionaries"
Call CreateCatalog "KorteVerhalenEnGedichten"
Example of CreateCatalog.bat
Code:
SET TAGNAME=%~1
SET TAGS=tags:"=%TAGNAME%"

"C:\Program Files (x86)\Calibre2\calibredb" catalog "G:\My Documents\Calibre Bibliotheek\%TAGNAME%.epub" -s %TAGS%
"C:\Program Files (x86)\Calibre2\calibredb" add --tags Catalog --title %TAGNAME% --authors "Calibre" "G:\My Documents\Calibre Bibliotheek\%TAGNAME%.epub"
DEL "G:\My Documents\Calibre Bibliotheek\%TAGNAME%.epub"
This will run in Winows as a batch file.

Thanks anyway for the help.

Regards,
Willum
Willum is offline   Reply With Quote
Old 02-07-2013, 02:54 PM   #10
Willum
Junior Member
Willum began at the beginning.
 
Posts: 7
Karma: 10
Join Date: Feb 2013
Device: none
Ok, now I have it worked out.
This will create the catalogs in a windows environment:

catalog.bat:
Code:
@ECHO OFF
Call CreateCatalog "Detectives" 
Call CreateCatalog "Detectives en Thrillers"
Call CreateCatalog "Dictionaries"
Call CreateCatalog "Fantasy"
Call CreateCatalog "Jeugdboeken"
Call CreateCatalog "Korte verhalen en Gedichten"
Call CreateCatalog "Literatuur en Romans"
Call CreateCatalog "Literatuur klassiek"
Call CreateCatalog "Non-fictie"
Call CreateCatalog "Reisverhalen"
Call CreateCatalog "Reizen"
Call CreateCatalog "Science Fiction"
Call CreateCatalog "Spionage"
Call CreateCatalog "Thrillers"

:: 
:: Create a separated book with all series 
::
SET CALIBREDBPROG="C:\Program Files (x86)\Calibre2\calibredb"
SET TARGETFILE="G:\My Documents\Calibre Bibliotheek\Series.epub" 

%CALIBREDBPROG% catalog %TARGETFILE% -s "series:true"
%CALIBREDBPROG% add --tags Catalog --title Series --authors "Calibre" %TARGETFILE%
DEL %TARGETFILE%

EXIT
CreateCatalog.bat:
Code:
SET CALIBREDBPROG="C:\Program Files (x86)\Calibre2\calibredb"
SET TAGNAME=%~1
SET TAGS=tags:\"=%TAGNAME%\"
SET TARGETFILE="G:\My Documents\Calibre Bibliotheek\%TAGNAME%.epub" 

%CALIBREDBPROG% catalog %TARGETFILE% -s "%TAGS%"
%CALIBREDBPROG% add --tags Catalog --title "%TAGNAME%" --authors "Calibre" %TARGETFILE%
DEL %TARGETFILE%
Willum is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem creating catalog beckywc Library Management 10 12-05-2012 04:27 PM
Using custom metadata when creating a catalog grobinson Library Management 2 01-07-2012 01:17 PM
Problem Creating Catalog of ISBNs desilva Library Management 4 08-09-2011 07:44 PM
Error creating an epub catalog pscynthetiq Library Management 1 03-23-2011 07:52 AM


All times are GMT -4. The time now is 01:27 PM.


MobileRead.com is a privately owned, operated and funded community.