Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 01-14-2011, 03:47 PM   #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: 17
Karma: 7700
Join Date: Jan 2011
Device: kindle
Fixing your library: A few How-to in Search & Replace

I ran into some problems with my Calibre library. I had 12,000 reports & books, and 3 thou authors (which should had been less than a thousand). The author and title fields were completely messed up. I needed to clean them to get a better grasp of my library. It was taking me a hell of a long time doing it manually. So, I studied the program a little and posted a few questions in the forum. A very special user, chaley, came to my rescue and I was able to organize my huge library in a single day (Thanks again chaley). Thus, I would like to share my specific problems and the solutions for others to benefit.

Problem 1: Rearrange Authors.
Several authors were in the form: Lastname, Firstname, which is not needed by caliber since automatically sorts by last name. Thus, I wanted them as Firstname Lastname.

How to correct these occurrences in your library?
  1. In Advance Search (the binoculars icon), input a coma "," in Author, and click Ok.
  2. Select all books [Ctrl][a]
  3. Go to bulk edit, Search & Replace, Regular Expression, Search Field: Author
  4. Search: (.*),(.*)
  5. Replace: \2 \1
A word of caution: Always check the Test Window before clicking OK, and make a backup of your library before starting.

Problem 2: Cleaning the Title.
Several titles have .txt or .doc or .lit or .v1, etc. at the end, which prevents fetching the metadata from internet.
How can you get rid of this nuisance?
  1. Advance Search, input a dot “.” in Title, and click Ok.
  2. Select the appropriate books.
  3. Go to bulk edit, Search & Replace, Regular Expression, Search Field: Author
  4. Search: (.*)\.(.*)
  5. Replace: \1
Problem 3: Carving out the series.
Several titles (or authors) fields have the series information, which prevent you from fetching the metadata.
Generally the information is different. I provide 2 examples:
1st Example: Series index has one digit.

The Mean Nutmeg - Stories of Past 1
The Idiot King -Biosaga 5
The Pink Sock - Underwear Tales 9... and so on.


So, how do you carve out the series information from the title field into the series field?
  1. Go to Advance Search, input a dash “-” in Title, and click OK.
  2. Select the relevant books.
  3. Go to bulk edit, Search & Replace, Regular Expression, Search Field: Title, Destination Field: Series
  4. Search: .*- (.*)(\d)
  5. Replace: \1 [\2]
  6. Click on Apply.

2nd Example: Series index has two digits.

The Numen - Stories of Past 12
The Idiot King -Saga of After 21
The Pink Sock - Tales 12... and so on.


So, you change a little your search and replace notation to:
  1. Search: .*- (.*)(\d)(\d)
  2. Replace: \1 [\2\3]
Now you need to clean your title field, removing the unwanted series info. How do you do it?
  1. Destination Field: Title
  2. Search: (.*)-.*
  3. Replace: \1
  4. Click on OK.


I suggest you check the following links:
https://manual.calibre-ebook.com/template_lang.html
https://manual.calibre-ebook.com/regexp.html

I hope this is useful.

Last edited by BetterRed; 08-21-2017 at 08:47 AM. Reason: correct links - ack flink
flopis is offline   Reply With Quote
Old 02-17-2013, 01:23 PM   #2
sunnyace
Junior Member
sunnyace began at the beginning.
 
Posts: 2
Karma: 10
Join Date: Jan 2013
Device: none
This is really helpful! Thank you!
sunnyace is offline   Reply With Quote
Advert
Old 08-16-2017, 03:10 PM   #3
Georgie W
Connoisseur
Georgie W began at the beginning.
 
Georgie W's Avatar
 
Posts: 96
Karma: 10
Join Date: Jan 2014
Location: Scotland
Device: KT4 5.13.6
Fixing your library: A few How-to in Search & Replace

Brilliant - just what I needed. Thanks.
Georgie W is offline   Reply With Quote
Old 08-17-2017, 12:43 PM   #4
fidvo
Addict
fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.fidvo ought to be getting tired of karma fortunes by now.
 
Posts: 309
Karma: 1645952
Join Date: Jun 2012
Device: none
Thanks for putting this together. The author trick is especially helpful. I've always just fixed the authors by hand, but that can get tedious.

Something to be aware of: Book titles may have a legitimate period or dash in them, and authors may have a legitimate comma, for instance if their name includes a degree. ALWAYS inspect each book title/author visually before selecting it to be included in the search/replace. You don't want to turn "John Smith, MD" into "MD John Smith."

I would recommend doing the search/replace in small to medium batches. If you've spent several minutes CTRL-clicking on hundreds of books as you've identified the ones to fix, it can be annoying to accidentally click on another book and lose your selection. Better to spend only a few seconds selecting books, running the replace, then repeating the process multiple times. If you save the searches, you can always come back to them in just a couple of clicks.
fidvo is offline   Reply With Quote
Old 08-21-2017, 07:27 AM   #5
flink
Banned
flink began at the beginning.
 
Posts: 22
Karma: 10
Join Date: Jun 2010
Device: Android/Linux/Windows
Updated links:

Template language: https://manual.calibre-ebook.com/template_lang.html

Regex: https://manual.calibre-ebook.com/regexp.html
flink is offline   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Search & Replace Pat Nickholds Sigil 2 10-21-2010 11:18 PM
Search & replace TEXT ToeRag Calibre 3 04-10-2010 01:44 PM
Feature Request - replace "screensavers" with randomly selected book covers from libr nathander13 Calibre 3 12-02-2009 12:21 PM
Question - Does iLiab have the "search" & "annotation, highlighting" features? HiSoC8Y iRex 5 07-01-2009 04:37 PM
Swap "Prev Page" & "Next Buttons" ???? kilofox Amazon Kindle 6 04-02-2008 11:39 PM


All times are GMT -4. The time now is 01:05 PM.


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