Register Guidelines E-Books Today's Posts Search

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

Notices

Reply
 
Thread Tools Search this Thread
Old 12-13-2013, 10:21 PM   #1
Dammie
Junior Member
Dammie began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle keyboard
Please help on a Save to Disk template

I've been trying to start a fresh with my calibre library but it has been a while and even though I've gone back to refresh my memory, my new template is not working. I'm using -

{author_sort:.1}/{author}/{series}/{title} - {series}{series_index:0>2s| -|- }{author}

Which I want to be -
A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Title - Series -03- Author

eg: J > Robert Jordan > Wheel of Time > The Eye of the World – Wheel of Time -01- Robert Jordan

But its just not happening and I can't figure it out. I also, like another forum post I have some series have novellas or short stories between books, so I have some entries' series numbers labeled like 2.50. Which I want to save series as 01, 02, 02.50, 03.
Which the response was -

{author_sort}/{series:||/}{series_index:re(^(\d)(\.|$),0\1\2)||. }{title}

but I am just not sure how to add this into my template.


Please help I am really confused!
Thank you for any help
Dammie is offline   Reply With Quote
Old 12-14-2013, 11:57 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
According to what you wrote, it should be working just fine. What are you getting instead?

And when you want to save as 01, 02, 02.5, 03 do you mean as a subfolder of series? If so, you just need to add /{series_index}/ to your template.

Also, your current template has a problem that makes it not work properly if there is no series. Do you see the
Quote:
:|{stuff1}|{stuff2}
in your template? This allows you to only add {stuff1} before the series_index and {stuff2} after, IF series_index exists.
See http://manual.calibre-ebook.com/temp...ced-formatting for a more in-depth explanation.

Your current template should therefore look like this:

Quote:
{author_sort:.1}/{author}/{series:||/}{title}{series:| - |}{series_index:0>2s| -|- }{author}
not like this

Quote:
{author_sort:.1}/{author}/{series}/{title} - {series}{series_index:0>2s| -|- }{author}
I have moved the "/" which separates folders from after the series to the conditional after-the-series-if-series-exists, and same goes for the " - " right before the second {series}.

if you wish to switch from "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Title - Series -03- Author" to "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Series Number (if applicable) > Title - Series -03- Author" then use this instead (addition in red)

Quote:
{author_sort:.1}/{author}/{series:||/}{series_index:0>2s||/}{title}{series:| - |}{series_index:0>2s| -|- }{author}
eschwartz is offline   Reply With Quote
Advert
Old 12-15-2013, 10:59 AM   #3
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,782
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 eschwartz View Post
According to what you wrote, it should be working just fine. What are you getting instead?

And when you want to save as 01, 02, 02.5, 03 do you mean as a subfolder of series? If so, you just need to add /{series_index}/ to your template.

Also, your current template has a problem that makes it not work properly if there is no series. Do you see the in your template? This allows you to only add {stuff1} before the series_index and {stuff2} after, IF series_index exists.
See http://manual.calibre-ebook.com/temp...ced-formatting for a more in-depth explanation.

Your current template should therefore look like this:



not like this



I have moved the "/" which separates folders from after the series to the conditional after-the-series-if-series-exists, and same goes for the " - " right before the second {series}.

if you wish to switch from "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Title - Series -03- Author" to "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Series Number (if applicable) > Title - Series -03- Author" then use this instead (addition in red)
why do you think this should work?
I see 1 glaring error (according to the example on the STD template page)

{author_sort[1]}

I have used the field substring in 2 places:
{author_sort[1]}_authors/ ...
{series[1]}-series/
theducks is offline   Reply With Quote
Old 12-15-2013, 02:27 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by theducks View Post
why do you think this should work?
I see 1 glaring error (according to the example on the STD template page)

{author_sort[1]}

I have used the field substring in 2 places:
{author_sort[1]}_authors/ ...
{series[1]}-series/
Can you please explain what that is supposed to mean? The only thing I can get out of that is "use substring in series" and I'm not sure how that fits in.
eschwartz is offline   Reply With Quote
Old 12-15-2013, 03:43 PM   #5
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,782
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 eschwartz View Post
Can you please explain what that is supposed to mean? The only thing I can get out of that is "use substring in series" and I'm not sure how that fits in.
You did show you wanted a substring of the Authors name
square brackets with a 1 returns the first letter of Author_sort, which is usually the last name
theducks is offline   Reply With Quote
Advert
Old 12-15-2013, 03:48 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by theducks View Post
You did show you wanted a substring of the Authors name
square brackets with a 1 returns the first letter of Author_sort, which is usually the last name
I think you will need a zero there actually. But the ":.1" already does that.

And what was that about series???
eschwartz is offline   Reply With Quote
Old 12-15-2013, 03:53 PM   #7
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,782
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 eschwartz View Post
I think you will need a zero there actually. But the ":.1" already does that.

And what was that about series???
:.1 Where did this notation come from? NOT the help section on the STD template screen.

Using in series is:
Just an Example doing the same type of thing
theducks is offline   Reply With Quote
Old 12-15-2013, 04:00 PM   #8
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Well then, it seems we're both right, because using :.1 from the example (this is my first time using a substring, and first thing I did was test out the OP's string) works.

Plus this, once I looked it up in response to your prompting: http://manual.calibre-ebook.com/temp...ced-formatting

Quote:
If you want only the first two letters of the data, use:

{author_sort:.2} - Only the first two letter of the author sort name

The calibre template language comes from python and for more details on the syntax of these advanced formatting operations, look at the Python documentation.
eschwartz is offline   Reply With Quote
Old 12-15-2013, 04:32 PM   #9
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
On experimenting, it seems "[number]" returns the character at the numbered offset, starting from 0 not 1 and ":.number" will return the first "number" characters.

But I can't actually find any reference to "[number]" on the calibre manual -- where did you see it exactly?
eschwartz is offline   Reply With Quote
Old 12-15-2013, 06:15 PM   #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,782
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 eschwartz View Post
On experimenting, it seems "[number]" returns the character at the numbered offset, starting from 0 not 1 and ":.number" will return the first "number" characters.

But I can't actually find any reference to "[number]" on the calibre manual -- where did you see it exactly?
Look Here!
Attached Thumbnails
Click image for larger version

Name:	sort.jpg
Views:	464
Size:	131.4 KB
ID:	116752  
theducks is offline   Reply With Quote
Old 12-15-2013, 06:22 PM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Ah, cool. I usually get my info from http://manual.calibre-ebook.com/template_lang.html

Must remember this.
eschwartz is offline   Reply With Quote
Old 12-16-2013, 02:40 AM   #12
Dammie
Junior Member
Dammie began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle keyboard
Quote:
Originally Posted by eschwartz View Post
According to what you wrote, it should be working just fine. What are you getting instead?

And when you want to save as 01, 02, 02.5, 03 do you mean as a subfolder of series? If so, you just need to add /{series_index}/ to your template.

Also, your current template has a problem that makes it not work properly if there is no series. Do you see the in your template? This allows you to only add {stuff1} before the series_index and {stuff2} after, IF series_index exists.
See http://manual.calibre-ebook.com/temp...ced-formatting for a more in-depth explanation.

Your current template should therefore look like this:



not like this



I have moved the "/" which separates folders from after the series to the conditional after-the-series-if-series-exists, and same goes for the " - " right before the second {series}.

if you wish to switch from "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Title - Series -03- Author" to "A (1st letter of Authors last name) > Author (First Last) > Series (if applicable) > Series Number (if applicable) > Title - Series -03- Author" then use this instead (addition in red)

Thanks for all the help! I was actually making a silly mistake in thinking it would change the way books are added to library and not saving to disc. Is there a way to change my template into regular expression?

When I used it properly and used your example eschwartz there is a problem when there is not a series. The title and author run together as in - CursedJennifer L. Armentrout instead of Cursed - Jennifer L. Armentrout I tried to fix it by adding a - to the template but then when a book has a series I get two -- . What would be the proper way to fix it?

Thanks again!!
Dammie is offline   Reply With Quote
Old 12-16-2013, 02:54 AM   #13
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Whoops! Here you go:

Quote:
{author_sort:.1}/{author}/{series:||/}{title} - {series}{series_index:0>2s| -|- }{author}
The " - " should not have a series dependency. The part in red will not be there if series=null. Versus my original:

Quote:
{author_sort:.1}/{author}/{series:||/}{title}{series:| - |}{series_index:0>2s| -|- }{author}
After my lecture and everything, I make the same mistake. IN my corrections....

This time I tested in calibre.

Last edited by eschwartz; 12-16-2013 at 03:04 AM. Reason: added some red
eschwartz is offline   Reply With Quote
Old 12-16-2013, 02:57 AM   #14
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
What do you want to do with a regular expression?
eschwartz is offline   Reply With Quote
Old 12-16-2013, 04:11 AM   #15
Dammie
Junior Member
Dammie began at the beginning.
 
Posts: 3
Karma: 10
Join Date: Aug 2012
Device: kindle keyboard
Quote:
Originally Posted by eschwartz View Post
What do you want to do with a regular expression?
Thank you, the new template works really well

I was thinking I might be able to use it to save the calibre library as eg: J > Robert Jordan > Wheel of Time > The Eye of the World – Wheel of Time -01- Robert Jordan instead of the standard Author > Title
Dammie is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
save to disk template and title info tsolignani Library Management 2 02-02-2013 10:44 AM
Save to disk simulation and template weird error? khonshu Library Management 0 12-23-2012 03:15 PM
Need help on a Save to Disk template fidvo Library Management 2 08-12-2012 03:34 PM
Save to disk template help plz. Crusher Conversion 12 03-15-2012 03:14 PM
save to disk template speakingtohe Calibre 9 05-29-2010 06:02 AM


All times are GMT -4. The time now is 04:32 PM.


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