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

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
 
iomari's Avatar
 
Posts: 134
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
"chaley", not "charley"
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: 5,187
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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
Old 10-10-2011, 06:57 AM   #3
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
iomari's Avatar
 
Posts: 134
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
 
iomari's Avatar
 
Posts: 134
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
"chaley", not "charley"
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: 5,187
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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
Old 10-11-2011, 06:39 AM   #6
iomari
Zealot
iomari doesn't litteriomari doesn't litter
 
iomari's Avatar
 
Posts: 134
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
"chaley", not "charley"
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: 5,187
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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
Grand Sorcerer
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: 14,429
Karma: 5560777
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
@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
"chaley", not "charley"
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: 5,187
Karma: 821512
Join Date: Jan 2010
Location: France
Device: Many android devices
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
Grand Sorcerer
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: 14,429
Karma: 5560777
Join Date: Aug 2009
Location: The (original) Silicon Valley, USA
Device: Galaxy Tab 2, Astak Pocket Pro, K4NT
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
 
iomari's Avatar
 
Posts: 134
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

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 11:04 AM.


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