![]() |
#1 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31
Karma: 103134
Join Date: Feb 2010
Device: iPhone
|
Searching and replacing in different fields
I imported some books that had titles like “Name of Series 01 Title of First book in series”. I tried to use the multi-edit find and replace to set the series name and index number and was able to do so. I ended up doing it by hand, but I am curious if this is possible.
First, I searched title for (\d\d) and tried to set the index number to \1 but got a string conversion error. I am guessing that Calibre did not like the ’01’ and that I would need to somehow get a ‘1’ and also get a ’11’, but I didn’t have time to figure out the regex for that… ([1-9]?\d) maybe?) Also, it looks like this would have to be done in two steps, at minimum, one to set the series name and on to set the index number, or is there a way to set both fields in one swell loop? |
![]() |
![]() |
![]() |
#2 | |
Zealot
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 112
Karma: 53342
Join Date: Jun 2013
Device: Sony PRS-600
|
Quote:
^(.*?) (\d+)\s* Assigning to series as\1 [\2] That is,Name of Series 01 Title of First book in series results in the series and series index ofName of Series [1.00] because of how the series_index is managed after assignment. The title and sort_title are unchanged. You'll have to go back a second time to remove the name of the series and the series_index value from the title... which is why I wrote the RE as I did, so it can be reused (apply find and replace on title, assigning nothing to the title, will replace 'Name of Series 01 ' with nothing, leaving you with 'Title of First book in series' in the title field).
|
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 31
Karma: 103134
Join Date: Feb 2010
Device: iPhone
|
Thanks you!
|
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Searching Metadata fields e.g. Comments | grove | Library Management | 1 | 09-28-2021 04:42 PM |
How to prevent metadata download from replacing data with empty fields? | Naed | Library Management | 4 | 03-28-2021 03:23 AM |
Replacing code without replacing text? | ElMiko | Sigil | 6 | 11-30-2011 08:14 PM |
Searching for.... in fields help needed | mezme | Calibre | 8 | 02-07-2010 10:32 AM |
Question about doing some searching and replacing in Word | texasnightowl | Workshop | 6 | 09-11-2008 09:20 AM |