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 03-09-2021, 06:22 PM   #1
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Template: Incrementing a padded number by one

Using a template in Action Chain's "single field edit", how would I go about making this sort of change?

OEBPS/file0011.xhtml#kobo.194.1 ==> OEBPS/file0012.xhtml#kobo.1.1

OEBPS/file0999.xhtml#kobo.123.456 ==> OEBPS/file1000.xhtml#kobo.1.1

(I can strip off the #kobo.1.1 if it makes things simpler.)

Context for what I'm trying to do.


Last edited by ownedbycats; 03-09-2021 at 06:38 PM.
ownedbycats is offline   Reply With Quote
Old 03-09-2021, 07:43 PM   #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: 12,443
Karma: 8012886
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Code:
program:
	input = 'OEBPS/file0011.xhtml#kobo.194.1';
	a = re(input, '^OEBPS/file(\d{4})(\.xhtml.*$)', '\1');
 	strcat('OEBPS/file', format_number(add(a, 1), '04d'), '.xhtml#kobo.1.1')
chaley is offline   Reply With Quote
Advert
Old 03-09-2021, 07:54 PM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 10,970
Karma: 75337983
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
Hmm, putting that in the template tester results in file0012 for everything.

EDIT: I remembered what to do after checking the reference again. i changed it to input = field('#kobobookmark') and that works.

Thank you!

Last edited by ownedbycats; 03-09-2021 at 08:24 PM.
ownedbycats is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Incrementing a column for selected books tranquilo2 Library Management 7 08-24-2020 11:48 AM
Rename template for "number of pages" r728626 Calibre 20 03-09-2019 01:50 AM
Is there a way to have an incrementing playcount JohnMeloche Library Management 4 10-13-2014 10:45 AM
Mainframe in a padded, zipper, case knc1 Kindle Developer's Corner 1 08-25-2013 11:22 AM
Version not incrementing rbruceporter Calibre 11 11-27-2010 04:39 PM


All times are GMT -4. The time now is 01:26 PM.


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