View Single Post
Old 10-03-2019, 12:06 PM   #2
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: 31,079
Karma: 60358908
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 Horus68 View Post
Newbie question and after reading the docs https://manual.calibre-ebook.com/template_lang.html on functions and I had no clue how to get it implemented!

How can I concatenate arguments in a replace function when saving to disk template?

Lets say I want to replace the punctuation signs ! and ? with an underscore from the title field when saving to disk using template.

this works for one...
Code:
{title:re(\!,_)}
how can I also replace ? with an underscore in the same field ?
If that was your only goal, I don't think you need to do anything special. a simple {title} should already make a file system safe filename using STD
Preferences: Saving to Disk: may need a tick next to replace space with underscore
theducks is online now   Reply With Quote