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 11-24-2012, 01:32 AM   #1
Illyrie
Member
Illyrie began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: iPad
Troubleshooting a Save Template.

I have two questions about a save template I am using.

The template is:
{#read}/{author_sort:re(&.*,)}/{series}/{series} {series_index:0>3s| | - }{title}/{title}

and it seems to be working fairly well. But when author has initials for a first name, e.g., J.K. Rowling then the path name becomes Rowling, J.K_ as opposed to Rowling, J.K.

Is there anyway to fix that?

Question the second...
Am I going to run into major issues with having periods and commas in my path? I am mainly using this on PC and an iPad. If so, is there a way to make it "LAST First" instead of "Last, First" and remove the periods but only when I save to disk?

Thanks so much!

Last edited by Illyrie; 11-24-2012 at 01:36 AM.
Illyrie is offline   Reply With Quote
Old 11-24-2012, 04:40 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,693
Karma: 6240117
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by Illyrie View Post
I have two questions about a save template I am using.

The template is:
{#read}/{author_sort:re(&.*,)}/{series}/{series} {series_index:0>3s| | - }{title}/{title}

and it seems to be working fairly well. But when author has initials for a first name, e.g., J.K. Rowling then the path name becomes Rowling, J.K_ as opposed to Rowling, J.K.

Is there anyway to fix that?
No. Periods are not allowed at the end of a file name.
Quote:

Question the second...
Am I going to run into major issues with having periods and commas in my path? I am mainly using this on PC and an iPad. If so, is there a way to make it "LAST First" instead of "Last, First" and remove the periods but only when I save to disk?
Ignoring the uppercase LAST, you can remove the commas the same way you are removing the additional authors.
Code:
{#read}/{author_sort:re(\,|&.*,)}/{series}/{series} {series_index:0>3s|  | - }{title}/{title}
If you really want "LAST First" you will need a much more complicated template that uses general program mode. You would first remove the additional authors, then split the remaining author into two parts around the comma, then uppercase the first part, then recombine the two parts together. The final step would be to insert the computed author name into the right spot in the rest of the template. This isn't a trivial process.
chaley is offline   Reply With Quote
Advert
Old 11-24-2012, 01:54 PM   #3
Illyrie
Member
Illyrie began at the beginning.
 
Posts: 11
Karma: 10
Join Date: Nov 2012
Device: iPad
Wonderful. Thanks so much.

I did some testing with my devices and they really don't seem to mind the comma, so I've decided to leave it in but strip the periods in the initials.

The final (for the moment) template came out to be:

Code:
{#read}/{author_sort:re(\.|&.*,)}/{series:||/}{series|| }{series_index:0>3s|  | - }{title}/{title}
My next question is a little more problematic (and programmatic). Is there a way to only include the
Code:
{series|| }{series_index:0>3s|  | - }{title}/
portion if there are more than 1 book in the series?

For example, I have quite a few books that are parts of series that I only have one book in. I don't need the extra level of "/Series 01- Title/"

I don't know python, but I assume we could do something like a loop through a {series} counting the {series_index} and if the count is greater than 1, include "{series|| }{series_index:0>3s| | - }{title}/" else leave it blank?
Illyrie is offline   Reply With Quote
Old 02-08-2014, 04:14 AM   #4
zhorro
Junior Member
zhorro began at the beginning.
 
Posts: 1
Karma: 10
Join Date: May 2005
Device: Pocket Loox 710
For example, I have quite a few books that are parts of series that I only have one book in. I don't need the extra level of "/Series 01- Title/"

Have you found out how to make this?
zhorro is offline   Reply With Quote
Old 02-08-2014, 04:56 AM   #5
itimpi
Wizard
itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.itimpi ought to be getting tired of karma fortunes by now.
 
Posts: 4,552
Karma: 950151
Join Date: Nov 2008
Device: Sony PRS-950, iphone/ipad (Marvin/iBooks/QuickReader)
Quote:
Originally Posted by zhorro View Post
For example, I have quite a few books that are parts of series that I only have one book in. I don't need the extra level of "/Series 01- Title/"

Have you found out how to make this?
I do not think that this will be at all easy. As far as I know the Save template only has access to information about the current book.
itimpi is offline   Reply With Quote
Advert
Old 02-08-2014, 11:12 AM   #6
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,662
Karma: 54369090
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 itimpi View Post
I do not think that this will be at all easy. As far as I know the Save template only has access to information about the current book.

Only 1 is a common occurrence in my Library.
Sometimes it is the first book of a series that did not fly

Sometimes it is the last book that is the only one in e-edition, but I usually have 'Empty books' for the ones in my paper library.

Sometimes I did not flag a book belonging to a series because IT WAS NOT LISTED at the time of purchase. (just happened to me with: Carousel Tides)
theducks is online now   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
Save template problem antoon Library Management 12 08-17-2012 12:47 PM
Need help on a Save to Disk template fidvo Library Management 2 08-12-2012 03:34 PM
[Old Thread] Save Template not working TGinAZ Calibre 7 01-18-2012 01:03 AM
A little help with a save template...? Belfaborac Library Management 2 02-04-2011 09:47 PM
save to disk template speakingtohe Calibre 9 05-29-2010 06:02 AM


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


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