12-01-2015, 07:59 AM | #1 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2013
Device: Kobo
|
Search and Replace; delete "author" name from "serie"
I've a large collection of books in Calibre that has the 'author' name displayed in the 'serie' field. Too many to do a manual selection.
Hence I'm looking for a search and replace expression that can check the author name from the 'author' field against the text in the 'serie' field and replace or remove that particular string from the 'serie' field. |
12-06-2015, 07:34 PM | #2 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
You can't really compare two fields.
What you can do, maybe, is the following: Search field: {template} Template: Code:
program: re(field('series'), field('authors'), '') Code:
(.*) Code:
\1 ... This should use as the source, a template which regexes out the content of the "authors" field from the series field, and then replace the series field with the contents of that source template. |
Advert | |
|
12-07-2015, 05:47 AM | #3 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2013
Device: Kobo
|
Thanks for the suggestion.
A first attempt with the above scripting didn't quite solve the issue, but I appreciate the approach. I'll give it some more attempts later using this as a starting point. Thanks again. |
12-07-2015, 09:55 AM | #4 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
In what way did it fail? It looks OK to me (and I did a couple tests with my test library), so I'm not sure what could be fixed, but if you tell me how it isn't working for you, I could try again.
|
12-09-2015, 07:03 AM | #5 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2013
Device: Kobo
|
Thanks for following up.
I'm currently travelling with limited access to my database and even lesser time to run a few examples, but will come back to you after my trip. |
Advert | |
|
12-17-2015, 03:47 AM | #6 |
Junior Member
Posts: 5
Karma: 10
Join Date: Oct 2013
Device: Kobo
|
My bad. It actually works quite well (as you already concluded).
I've created a new test-database with some typical examples and all went well this time. It might have been an issue with the author sorting or maybe the localized language set of my previous testdatabase. Great thing is that the script also helps me cleaning up titles containing strings from the author or serie field. So great thanks for this. You've given me significant quality time back. |
12-17-2015, 11:38 AM | #7 |
Ex-Helpdesk Junkie
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
|
Excellent. And thanks for getting back with a confirmation.
|
Tags |
search & replace, search and replace |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to search Author column for "The " or "A " | Inferno | Library Management | 11 | 07-28-2014 05:24 PM |
Choice lists for "Search" and "Replace" | korben | Editor | 7 | 07-18-2014 04:03 PM |
Question: addition of "virtual libraries" (was "base search restriction") | chaley | Library Management | 53 | 04-15-2013 12:52 PM |
Question - Does iLiab have the "search" & "annotation, highlighting" features? | HiSoC8Y | iRex | 5 | 07-01-2009 04:37 PM |