![]() |
#586 | |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Quote:
![]() PHP Code:
PHP Code:
Last edited by eschwartz; 09-19-2014 at 01:54 PM. |
|
![]() |
![]() |
![]() |
#587 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
FWIW: the complexity of this is starting to call for a custom template function.
I have somewhere a python script that scans the database, computes the minimum format to represent the largest series numbers and the minimum number of fractional digits, and stores the format in a custom column. I can post it tomorrow if anyone is interested and if I can find it. |
![]() |
![]() |
![]() |
#588 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Do you mean the one linked from post #585?
|
![]() |
![]() |
![]() |
#589 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#590 |
Zealot
![]() Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
I just tried running the code
I copied and pasted to a file I called complex-series.txt and saved in my user directory I then ran calibre-debug -e complex-series.txt It did nothing for a few minutes and then I was back at command line I opened calibre but couldn't spot anything new anywhere i) am I doing it right? ii) is that the full code you posted iii) where should data end up? |
![]() |
![]() |
![]() |
#591 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
1) change line 12 so that 'path-to-your-library' is the real path to your library. 2) change '#text' on line 34 to a lookup name of a text-type (not tags) custom column in your library. After you run the script you should see the number format in the text column for books with a series, similar to the screen capture below. You would use that format in the template when you generate series strings. |
|
![]() |
![]() |
![]() |
#592 |
Zealot
![]() Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
Now where's the blush icon......
Cheers :-) |
![]() |
![]() |
![]() |
#593 |
Zealot
![]() Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
OK, chaley's script ran fine - eventually
![]() But produces Leg-of-Eli-Mon [{0:01.0f}] The Spirit Thief when plugged into scrip?? |
![]() |
![]() |
![]() |
#594 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
s_index = format_number(field('series_index'), field('#complex_series')); |
|
![]() |
![]() |
![]() |
#595 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
![]() |
![]() |
![]() |
#596 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
The scheme permits you to copy the format instead of running the script if you know that the existing format is correct. It also permits you to change the format manually in one bulk edit if you change the series structure for a book. Feel free to change it if you want. |
|
![]() |
![]() |
![]() |
#597 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 19,421
Karma: 85400180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Ah, Okay. That makes sense. I like your way.
I just didn't realize at first what you were doing. |
![]() |
![]() |
![]() |
#598 |
Zealot
![]() Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
Chaley
I tried to be clever and amend your code so it produces {_>7.2f} which I thought would replicate the {series_index:_>7.2f} I used to use but it doesn't work....... |
![]() |
![]() |
![]() |
#599 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525
Karma: 8065948
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#600 |
Connoisseur
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 77
Karma: 3090
Join Date: Apr 2013
Location: California
Device: Kobo Aura One, Kobo Aura H20,Kindle PW1
|
Now that I have been able to configure the plugboards for specific outputs with all your excellent help, I was wondering how to create a regex in search and replace to clean up the title fields in my library.
I would like to remove the series and series_index from the title field: Examples I have found in the library are: The Alexander Cipher - Daniel Knox [1] Hidden Empire: The Saga of Seven Suns, Book 1 The Alexandria Link - Cotton Malone - 2 I would like to strip this down to the title alone and completely remove the series and series numbers Also there are a few entries that have other info that I would like to remove such as the ": A Novel" The Charlemagne Pursuit: A Novel but keeping in mind that there are titles that have the colon and extra title information that I would like to keep like: The Balkan Escape: A Cassiopeia Vitt Adventure - Cotton Malone [5.50] and the extra dashes from the title: The Amber Room - - I have colored the parts that I would like to remove Thanks crissman Last edited by crissman; 09-22-2014 at 11:24 PM. |
![]() |
![]() |
![]() |
Tags |
custom column, tag, tags |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Should composite columns appear in Grouped Searches? | ownedbycats | Library Management | 3 | 02-13-2021 03:43 PM |
Having problems with composite columns and save/send templates | Trel | Calibre | 4 | 09-26-2016 03:21 PM |
Tooltips for narrow columns | theducks | Library Management | 7 | 03-16-2015 10:58 PM |
Techniques to use plugboards, custom columns and templates | kovidgoyal | Library Management | 0 | 01-26-2011 04:21 PM |