Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-10-2011, 04:53 AM   #1
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
custom export

I currently use the following template for exporting my books to separate folders based on filetype:

{#supercat}/{tags}/{authors}/{title} - {authors}

It works fine for me. I chose which type to export and it neatly places chosen type in well organized folders. However I have to run the export for each book type that I have to achieve what I want. Is there a way to structure the template to place the various types into their respective folders? When I do each one manually I end up with different top folders for each type by choosing the parent when I save. I want to automate this whole process.
btw, #supercat is a custom tag. :-)
iomari is offline   Reply With Quote
Old 10-10-2011, 06:50 AM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
If you have one format per book, then you can use
{formats}/{#supercat}/{tags}/{authors}/{title} - {authors}

If you have multiple formats per book, then the above probably won't do what you want, as you will end up with folders named "EPUB, MOBI, PRC" or some such. I can't think of a way around this problem. This isn't any field available containing the current format.
chaley is offline   Reply With Quote
Advert
Old 10-10-2011, 06:57 AM   #3
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
Quote:
Originally Posted by chaley View Post
If you have one format per book, then you can use
{formats}/{#supercat}/{tags}/{authors}/{title} - {authors}

If you have multiple formats per book, then the above probably won't do what you want, as you will end up with folders named "EPUB, MOBI, PRC" or some such. I can't think of a way around this problem. This isn't any field available containing the current format.
Yes I have multiple formats per book and the first thing I tried was using {formats} but as you stated it gave me folders like you described.
iomari is offline   Reply With Quote
Old 10-11-2011, 06:01 AM   #4
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
In the left pane, the "formats" field shows the total for each format separately. How can I access the function that breaks down each format like that?
iomari is offline   Reply With Quote
Old 10-11-2011, 06:13 AM   #5
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by iomari View Post
In the left pane, the "formats" field shows the total for each format separately. How can I access the function that breaks down each format like that?
What exactly are you trying to do?

If you are trying to find a template language function that returns the number of (for example) epubs in the library, there isn't one. Template functions operate on individual books, not on a database.

If you are trying to find the number of formats for a specific book, then use the count function, as in {:'count(field('formats'), ',')'}.
chaley is offline   Reply With Quote
Advert
Old 10-11-2011, 06:39 AM   #6
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
Quote:
Originally Posted by chaley View Post
What exactly are you trying to do?

If you are trying to find a template language function that returns the number of (for example) epubs in the library, there isn't one. Template functions operate on individual books, not on a database.

If you are trying to find the number of formats for a specific book, then use the count function, as in {:'count(field('formats'), ',')'}.
I'm trying to export my books with the book formats as the top folder. my current template is:
{#supercat}/{tags}/{authors}/{title} - {authors}

what I want is something like:
{formats}/{#supercat}/{tags}/{authors}/{title} - {authors}

except I want a case where if there are multiple formats per book that a copy of each format gets placed in separate folders. Not where I would end up with folders like:

"EPUB, MOBI, TXT".

In a case like this, I want each book to get routed to:

EPUB/{#supercat}/{tags}/{authors}/{title} - {authors}
MOBI/{#supercat}/{tags}/{authors}/{title} - {authors}
TXT/{#supercat}/{tags}/{authors}/{title} - {authors}

Hope this is clear. I know I can get my hands dirty and write a custom script but I don't want to do so if there is an existing easier way of doing it.
iomari is offline   Reply With Quote
Old 10-11-2011, 08:05 AM   #7
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
As I said above, there is no way in the template language to know the current format being saved. In fact, even the part of calibre code that generates pathnames does not have access to the extension (format). Because of this, there is no way in the template language to route a particular format to a particular folder.
chaley is offline   Reply With Quote
Old 10-11-2011, 08:20 AM   #8
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
@Iomari
It is not as efficient, but you can get your output.

First: Search (or use the Tag Browser: Formats: ) to show only books that have the format you want.
Set your save template first folder (a literal) to the format name.
Code:
EPUB/{#supercat}/{tags}/{authors}/{title} - {authors}
Your example is a valid template.
You can use literals mixed in with field names.
theducks is offline   Reply With Quote
Old 10-11-2011, 08:22 AM   #9
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,733
Karma: 6690881
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by theducks View Post
@Iomari
It is not as efficient, but you can get your output.

First: Search (or use the Tag Browser: Formats: ) to show only books that have the format you want.
Set your save template first folder (a literal) to the format name.
Code:
EPUB/{#supercat}/{tags}/{authors}/{title} - {authors}
Your example is a valid template.
You can use literals mixed in with field names.
He said in the first post that he doesn't want to do that.
chaley is offline   Reply With Quote
Old 10-11-2011, 08:26 AM   #10
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 29,779
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by chaley View Post
He said in the first post that he doesn't want to do that.
Forgot that was said (it was that far back in the thread).
theducks is offline   Reply With Quote
Old 10-11-2011, 08:27 AM   #11
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
Posts: 146
Karma: 100
Join Date: Aug 2003
Location: Nigeria
Device: galaxy tab
Looks like I'm going to have to write a custom command line script to do this. I don't have a problem with that but if there was some built in way of doing it I would rather not spend the time writing what is already available.
iomari is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can custom book data be displayed in a custom column? kiwidude Development 9 03-02-2011 05:35 AM
Export help needed please kakkalla Library Management 18 01-28-2011 11:18 AM
Export just metadata? TheD0ct0r Calibre 3 12-11-2010 09:52 AM
Request Export the markups to pc mihai@alaphant.nl enTourage Archive 3 11-21-2010 05:19 PM
Import/Export Scullion Calibre 2 08-03-2009 01:15 AM


All times are GMT -4. The time now is 07:54 AM.


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