View Single Post
Old 01-13-2011, 09:43 AM   #1
flopis
Member
flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.flopis knows the square root of minus one.
 
Posts: 16
Karma: 7700
Join Date: Jan 2011
Device: kindle
Variable Search, Replace & Transfer to a new field

Calibre computes 12,000 reports & books, and 3 thou authors (which should be about 500). My author and title fields in my library are all messed up.

I would like to fix them with the search and replace in the bulk edit feature. Here are my specific questions:

1) In the author field I have several occurrences of "Lastname", "Firstname" for several authors. How can I correct this to Firstname Lastname in a variable way so that it respect the names of the different authors.
2) In the title field I have author, titles and series; sometimes separated by " - ", and other times by ":" How can I eliminate non-title info and transfer the series info to the series field?

For instance, I have -say- 20 occurrences for:
Alexander, Lloyd - Chronicles of Prydain 01 - The High King, Alexander, Lloyd - Chronicles of Prydain 02 - The Black Cauldron, ... Alexander, Lloyd - Chronicles of Prydain 20 - The Black Song.

What I have being doing --in Search & Replace (bulk meta edit), in the "search field title" (Regular Expression Mode)-- is the following:
(a) eliminate the author " Alexander, Lloyd - " by giving it a Search (I leave Replace blank), and
(b) eliminate the series info " Chronicles of Prydain xx" with the following command in the Search Field "Chronicles of Prydain [0-9]+ - ".

I end up with only the titles. However, that takes too long for so many authors and books.
I have already seen http://calibre-ebook.com/user_manual/template_lang.html and http://calibre-ebook.com/user_manual/regexp.html.
I have also experimented with the following expressions: (...), \\n, etc., but I have messed up.

Can anybody help me?
flopis is offline   Reply With Quote