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 08-26-2020, 10:18 PM   #1
rebeltaz
Connoisseur
rebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enough
 
rebeltaz's Avatar
 
Posts: 92
Karma: 536
Join Date: Apr 2011
Device: Entourage Pocket eDge
Possible to Do Multiple Replacements in a Save Template?

Under the save template currently is:

{title:re( ,.)}_{authors:re( ,.)}/{title:re( ,.)}_{authors:re( ,.)}

This works fine, unless a book begins with the word "the". It would then rename, let's say "the Stand by Stephen King" as "Stand,.the_Stephen.King" Notice the extraneous comma. I want this to remove the comma in this case and only use "Stand.the_Stephen.King". I have tried every permeation I could think of, but I cannot figure out how to get the Save Template to do multiple replacements within one string. Is this possible?
rebeltaz is offline   Reply With Quote
Old 08-26-2020, 11:53 PM   #2
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
It can be done, but, you need to use one of the other template modes. The following should work:
Code:
{title:'re(re($,' ',.),'\,','')'}_{authors:re( ,.)}/{title:'re(re($,' ',.),'\,','')'}_{authors:re( ,.)}
This is in template program mode. I usually do things like this in the general program mode, but you had half of it, so I kept going that way.
davidfor is offline   Reply With Quote
Advert
Old 08-27-2020, 12:03 AM   #3
rebeltaz
Connoisseur
rebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enoughrebeltaz will become famous soon enough
 
rebeltaz's Avatar
 
Posts: 92
Karma: 536
Join Date: Apr 2011
Device: Entourage Pocket eDge
Quote:
Originally Posted by davidfor View Post
It can be done, but, you need to use one of the other template modes. The following should work:
Code:
{title:'re(re($,' ',.),'\,','')'}_{authors:re( ,.)}/{title:'re(re($,' ',.),'\,','')'}_{authors:re( ,.)}
This is in template program mode. I usually do things like this in the general program mode, but you had half of it, so I kept going that way.
I don't know template program mode from general program mode but thank you! I appreciate that.
rebeltaz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple regexes in "save book to disk" template? Phssthpok Library Management 1 07-12-2018 04:20 AM
Save Template Query - Multiple Authors to Single Directory (for Series) curiosity Library Management 9 02-03-2018 12:09 AM
Can I use an IF statement in a Save template? kelemvor Library Management 1 07-29-2016 07:05 PM
Save Template Help Maverynthia Library Management 10 05-19-2014 12:37 PM
A little help with a save template...? Belfaborac Library Management 2 02-04-2011 09:47 PM


All times are GMT -4. The time now is 07:38 PM.


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