|
![]() |
|
Thread Tools | Search this Thread |
![]() |
#1 |
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jan 2009
Location: South Pacific
Device: Kindle DX
|
regex/search help needed to remove redundant metadata in different fields
So I've got some redundant data across fields, such as ISBNs listed in identifiers and in tags. or Authors listed in Tags, or Series Names listed in Tags
Once I identify them I can to a regex search and replace something like this template: {identifiers}, @@ {tags} search for: .*\bisbn ![]() replace with: \2\3 field: tags so if an ISBN in a tag matches the ISBN in identifiers it will delete the tag. However, if there is no matching tag, that regex dumps the whole "{identifiers}, @@ {tags}" into the tags field. If I could a) search for matching items across fields, or b) refine the regex so it doesn't corrupt the tags field when the pattern doesn't match... I'd be happy. Is there an elegant solution that I'm missing? I don't want a lot of built template columns slowing down operations. |
![]() |
![]() |
![]() |
#2 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Sidetrack - see Mufti Column Search
I'm not certain not sure it will do what you want, but worth a look BR |
![]() |
![]() |
![]() |
#3 | |
Enthusiast
![]() Posts: 39
Karma: 10
Join Date: Jan 2009
Location: South Pacific
Device: Kindle DX
|
Quote:
|
|
![]() |
![]() |
![]() |
#4 |
null operator (he/him)
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 21,725
Karma: 29711016
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
|
![]() |
![]() |
![]() |
#5 | ||
Deviser
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
|
MCS and Identifiers
Quote:
Both the 'Final Filters' Tab and 'SQL Queries' Tab handle identifiers. For your purposes, the 'SQL Queries' Tab should be used. See the image below of an example using the 'SQL Queries' Tab. Copy and paste this into that Tab: Quote:
Table _mcs_tags_by_book is an MCS "Search Accelerator" table. In lieu of using the latter table, you could JOIN standard Calibre tables tags and books_tags_link. However, if you have a lot of books with a lot of tags, that query will take much longer to execute. Hence, the MCS "Search Accelerator" table. By the way, the (industrial-strength) QuarantineAndScrub add-on automatically fixes the issues you described in your first post. The example in the image is from an actual Q&S test library with ISBN test cases. DaltonST |
||
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex search and replace in bulk metadata help | slantybard | Library Management | 7 | 08-20-2015 06:30 PM |
Pruning redundant and partially redundant tags | Sidetrack | Library Management | 0 | 03-01-2013 05:05 PM |
invert search for custom fields (GUI) | rogue_librarian | Library Management | 4 | 07-25-2011 11:36 AM |
Search and Replace or remove Metadata | jazzcat007 | Calibre | 5 | 05-21-2010 11:35 AM |
Searching for.... in fields help needed | mezme | Calibre | 8 | 02-07-2010 10:32 AM |