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 10-03-2019, 11:25 AM   #1
Horus68
Zealot
Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.
 
Horus68's Avatar
 
Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
Concatenate arguments in a replace function - Save to disk

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 ?

Last edited by Horus68; 10-03-2019 at 11:31 AM.
Horus68 is offline   Reply With Quote
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,056
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 offline   Reply With Quote
Advert
Old 10-03-2019, 12:13 PM   #3
Horus68
Zealot
Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.Horus68 understands the mechanisms of the catecholamine pathways.
 
Horus68's Avatar
 
Posts: 143
Karma: 76596
Join Date: Feb 2015
Location: Portugal
Device: Kobo Aura HD
Quote:
Saving to Disk: may need a tick next to replace space with underscore
Agree... done!

On the replace function:
Even if some signs are system safe filename using STD can I remove them in the same replace function?
Lets say to replace ! ? and comma from the file name with underscore?
Horus68 is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The {title_sort} replace the {title} value when doing save to disk job kevin4fly Devices 12 10-15-2018 01:45 PM
Unexpected behavior "Save to disk function" DrChiper Calibre 22 03-04-2017 09:34 AM
Nesting Function arguments in custom columns da_jane Calibre 1 11-21-2012 02:48 PM
Does Save To Disk replace older files with files that have newer metadata? unboggling Library Management 4 10-01-2011 11:52 AM
Save to Disk Function Lady Fitzgerald Calibre 8 06-07-2010 10:06 AM


All times are GMT -4. The time now is 05:44 PM.


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