12-25-2012, 04:50 PM | #1 |
Zealot
Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
Edit Metadata Search & Replace
I have recently discovered this feature and it can really help me if I can figure out how to use it. I am trying to get it to edit the title and search and replace a wild card.
Hell's Tempest [Fatefully Yours 4] Hypnotic Healing [Fatefully Yours 6] The Hunger [Fatefully Yours 7] How would I get it to find [Fatefully Yours *] and find all three? Is there a way I can get it to find anything enclosed in [] ? Thank you for your help |
12-25-2012, 06:00 PM | #2 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
You use Regular Expressions. RegExp.
There are a lot of special ways you can match different parts of the title. Because [ and ] has a special meaning in RegExps you have to "escape" them using a backslash to match them. This will match anything surrounded by []: \[.*\] This will match a single digit number: \d This will match a number, single digit or multiple digits. \d+ You group patterns using ( ) so you can reference each matching group by number later. \1, \2 and so on. In your case you could use this RegExp: (.*) \[(.*) (\d+)\] \1 = The part of the title before the []. \2 = The name of the series. \3 = The number of the book in the series. (Not tested...) There is a lot more to this. Check this thread for an actual example of how to use search and replace using RegExps: https://www.mobileread.com/forums/sho...43#post2242243 Last edited by Adoby; 12-25-2012 at 06:46 PM. |
Advert | |
|
12-25-2012, 08:08 PM | #3 |
Zealot
Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
This worked!! Thank you so much you saved me so much time
|
12-25-2012, 11:24 PM | #4 |
Zealot
Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
Ok you did that so awesome can you help me with this:
Demon Warriors 4: Takeo The Exiled 1: Nazaryth Brac Pack 17: Carter's Tryck I want them to read: Takeo Nazaryth Carter's Tryck Is there a search and replace I can do this all at once? Thank you again. |
12-26-2012, 12:47 AM | #5 |
Wizard
Posts: 4,812
Karma: 26912940
Join Date: Apr 2010
Device: sony PRS-T1 and T3, Kobo Mini and Aura HD, Tablet
|
(.*):
Should work Helen |
Advert | |
|
12-26-2012, 05:21 AM | #6 |
Handy Elephant
Posts: 1,736
Karma: 26785668
Join Date: Dec 2009
Location: Southern Sweden, far out in the quiet woods
Device: Thinkpad E595, Ubuntu Mate, Huawei Mediapad 5, Bouye Likebook Plus
|
Yes. Or:
(.*) (\d+): (.*) \1 = Series \2 = Number of book in series \3 = Book title (Not tested) |
12-26-2012, 01:06 PM | #7 |
Zealot
Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
Helen that worked great thank you. This software is way more powerful than I thought
|
12-26-2012, 01:43 PM | #8 |
Zealot
Posts: 114
Karma: 6288
Join Date: Dec 2012
Device: iphone
|
Ok one last one please. This is just saving my life.
Van, Becca - Double E Ranch Shaw, Christine - River's Pet, Angel Flynn, Joyee - Lust and Wrath Should be: Double E Ranch River's Pet, Angel Lust and Wrath I tried this but it didn't work (.*), (.*) - Was I even close? |
12-26-2012, 02:46 PM | #9 | |
Well trained by Cats
Posts: 29,804
Karma: 54830978
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Quote:
or (.+), (.+) - (.+) might work The first matches around the space dash space. The second matches a Last, First - title and might be useful if you are also flipping the author to Fn Ln: \2 \1 with the \3 in the title Star vs plus: * is zero or more, + plus is one or more. I only use * when there is a (desired) match of nothing. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Regex help: Edit Meta Search & Replace: Pad with zero | _noel_ | Calibre | 4 | 11-26-2012 04:31 PM |
2 Questions about Bulk Edit Search & Replace | BookJunkieLI | Library Management | 6 | 02-19-2012 01:39 PM |
Metadata Search & Replace - when it doesn't match | Aldebaranian | Library Management | 4 | 09-28-2011 11:35 AM |
Edit MultiData Search and Replace to multiple fields | Doug-W | Library Management | 1 | 02-22-2011 03:17 PM |
Setting series index in bulk metadata search&replace | bubak | Calibre | 4 | 12-19-2010 04:04 PM |