![]() |
#916 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Feb 2022
Device: Kindle2 (KB)
|
Explain me the plugboard
Hi, is there any regex guru who can help me to understand plugboard template "Show author name as Initial and Surname (Kindle) (inspired by brewjono)"? Im afraid i dont fully understand the syntax:
Code:
{author_sort:re(\, (.).*?( &|$),\, \1\2)} How the regex matches the string and how replaces the field? |
![]() |
![]() |
![]() |
#917 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Where are you seeing the result you say you get? If it is on a device then the device is changing it. Nothing the plugboard can do about that. Workarounds might be available but you should ask in the devices forum, naming your device. |
|
![]() |
![]() |
Advert | |
|
![]() |
#918 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Hello people
I have this configuration to save to disk. {title} ({#id}) - {authors} But the ID comes out with decimals, how could I fix it so that it is a whole number example: Title (10017301.0) - author.epub |
![]() |
![]() |
![]() |
#919 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
My guess is that {title} ({id}) - {authors} will work. |
|
![]() |
![]() |
![]() |
#920 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
For that reason # My mistake, for not seeing. Sorry Last edited by dunhill; 02-19-2022 at 03:33 PM. |
|
![]() |
![]() |
Advert | |
|
![]() |
#921 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#922 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
{title} ({#id:15.15g}) - {authors} |
|
![]() |
![]() |
![]() |
#923 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
|
![]() |
![]() |
![]() |
#924 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
I have a question about the id.
Let's suppose that I have an id that by order is added 100000000 Example: Original id 043579 + added 100043579 Question by means of a disk saving template could I get back the original id or a personal column by means of program: ? Example: id 100043579 - added 100000000 = id Original 043579 Last edited by dunhill; 02-20-2022 at 01:54 PM. |
![]() |
![]() |
![]() |
#925 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,341
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
program: $#id - 100000000 I suggest you look at the template language documentation. |
|
![]() |
![]() |
![]() |
#926 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Thanks because I was thinking about it with this post and it was simpler https://www.mobileread.com/forums/sh...17&postcount=8 Well not everything can be perfect. First of all I must say that I lack command of pyton, how could you add conditionals. Example: what remains if the number is between 10000000 and 10999999 only Last edited by dunhill; 02-20-2022 at 06:33 PM. |
|
![]() |
![]() |
![]() |
#927 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,714
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
Something like this should work.
Code:
program: ## obviously replace $#yournum with your column if $#yournum>=#10000000 && $#yournum<=#10999999 then ## using 'round' to fix the float/decimal output I got in my test round(subtract($#yournum, 100000000)) else $#yournum fi Last edited by ownedbycats; 02-21-2022 at 10:35 AM. |
![]() |
![]() |
![]() |
#928 | |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 867
Karma: 409968
Join Date: Sep 2017
Location: Buenos Aires, Argentina
Device: moon+ reader, kindle paperwhite
|
Quote:
Thank you very much, that solves the problem |
|
![]() |
![]() |
![]() |
#929 |
Custom User Title
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 10,714
Karma: 74203799
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
|
I use this as a stored template, readstatus().
Note that #percentread is integer and #readinglist is series-like managed with the Reading List plugin. Code:
program: if $$#percentread >=#1 && $$#percentread <=#99 then 'currentlyreading' elif "To Be Read" in $#readinglist && $$#percentread ==#0 then 'toberead' elif $$#percentread >=#100 then 'read' elif $$#percentread == 'None' then 'undefined' elif $$#percentread >=#0 then 'unread' fi It would probably also work as a composite column. Last edited by ownedbycats; 03-16-2022 at 10:18 AM. |
![]() |
![]() |
![]() |
#930 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 73
Karma: 673502
Join Date: Jan 2012
Device: enTourage pocket eDGe,Pyrus mini, NOOK HD+, KAO, S6, S8, KP4, Note 10+
|
Please, more skilled than me, this problem really overwhelms me, please help.
I have all the books in this format. W E Johns - [Biggles 31] - Biggles Delivers the Goods (epub).epub What is the correct way to import books into Calibre? Thank you and excuse the beginner question. edit: If i use Code:
(?P<author>[^_-]+) -?\s*(?P<series>[^_0-9-]*)(?P<series_index>[0-9]*)\s*-\s*(?P<title>[^_].+) ? W E Johns - Biggles 31 - Biggles Delivers the Goods (epub).epub so no square brackets ... Last edited by Arbait; 04-07-2022 at 02:54 PM. |
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
custom column i need a little help | shinken | Calibre | 3 | 09-15-2010 03:41 AM |
Using Custom Metadata in Save Template | EJvdH | Calibre | 1 | 07-02-2010 06:06 AM |
Accessories Decalgirl Kindle 2 custom skin template | srmalloy | Amazon Kindle | 6 | 04-09-2010 09:55 PM |
Donations for Custom Recipes | ddavtian | Calibre | 5 | 01-23-2010 04:54 PM |
Help understanding custom recipes | andersent | Calibre | 0 | 12-17-2009 02:37 PM |