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 12-01-2015, 07:59 AM   #1
roosten
Junior Member
roosten began at the beginning.
 
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.
roosten is offline   Reply With Quote
Old 12-06-2015, 07:34 PM   #2
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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)
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'), '')
Search for:
Code:
(.*)
Replace With:
Code:
\1
Destination field: series

...

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.
eschwartz is offline   Reply With Quote
Advert
Old 12-07-2015, 05:47 AM   #3
roosten
Junior Member
roosten began at the beginning.
 
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.
roosten is offline   Reply With Quote
Old 12-07-2015, 09:55 AM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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)
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.
eschwartz is offline   Reply With Quote
Old 12-09-2015, 07:03 AM   #5
roosten
Junior Member
roosten began at the beginning.
 
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.
roosten is offline   Reply With Quote
Advert
Old 12-17-2015, 03:47 AM   #6
roosten
Junior Member
roosten began at the beginning.
 
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.
roosten is offline   Reply With Quote
Old 12-17-2015, 11:38 AM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
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)
Excellent. And thanks for getting back with a confirmation.
eschwartz is offline   Reply With Quote
Reply

Tags
search & replace, search and replace


Forum Jump

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


All times are GMT -4. The time now is 01:25 AM.


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