09-19-2014, 01:44 PM | #586 | |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
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. |
|
09-19-2014, 04:21 PM | #587 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
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. |
Advert | |
|
09-19-2014, 05:13 PM | #588 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
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?
|
09-20-2014, 12:44 AM | #589 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
09-20-2014, 07:43 AM | #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? |
Advert | |
|
09-20-2014, 08:47 AM | #591 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
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. |
|
09-20-2014, 03:13 PM | #592 |
Zealot
Posts: 116
Karma: 10
Join Date: Jun 2011
Location: Stockport, UK
Device: ipad, iphone, kindle
|
Now where's the blush icon......
Cheers :-) |
09-21-2014, 07:14 AM | #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?? |
09-21-2014, 07:52 AM | #594 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
Quote:
Code:
s_index = format_number(field('series_index'), field('#complex_series')); |
|
09-21-2014, 08:43 AM | #595 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
|
09-21-2014, 09:32 AM | #596 | |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
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. |
|
09-21-2014, 10:44 AM | #597 |
Ex-Helpdesk Junkie
Posts: 19,422
Karma: 85397180
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. |
09-21-2014, 06:59 PM | #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....... |
09-22-2014, 02:40 AM | #599 |
Grand Sorcerer
Posts: 11,741
Karma: 6997045
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
|
|
09-22-2014, 10:57 PM | #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 |
|
Similar Threads | ||||
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 |