|
|
Thread Tools | Search this Thread |
02-02-2023, 05:23 PM | #1 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2017
Location: USA
Device: Kobo Clara, Pixel 6 (Moon Reader/Calibre Companion), Amazon Fire 10
|
Way to extract delimited part of title and copy it to author/series fields?
I have a fairly large periodical library; I'm organizing it by delimiting the title with a comma, with year and month following thereafter (as in "Gardens Illustrated, 2019 11," where Gardens Illustrated is the title, and 2019 11 the publication date).
For these, I've been formatting the author as "Gardens Illustrated, Staff of," and the series as (surprise!) "Gardens Illustrated." I have many magazines that are "stragglers"--solo or just a pair that currently list author as "Unknown" and have the series field empty; it would be great to avoid typing all of this just to satisfy my hyperfocusing self. Wondering if there is a plugin, or a regex formula of some sort, that can be employed to bulk edit these, taking the part of title before the delimiter "," and copying it into the author and series field--bonus points if it can add ", Staff of" to the author field, but that's not entirely necessary. It looks like Job Spy has some potential for doing this but just for self-made fields? Unsure. I apologize; for as fascinated by regex as I am in the abstract, it invariably proves to be a rabbit hole I dive down to find myself utterly frustrated five hours later. So asking ahead of time this time. |
02-02-2023, 06:00 PM | #2 | |
Well trained by Cats
Posts: 30,416
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Bulk mode search and replace.
Select A of 1 series (magazine) then tap 'E' Quote:
(.+?),\s(\d{4})\s(\d{1,2}) Decoded: 3 captures. anything up to a comma, 4 digits of year, 102 digits of month (note range is not permitted. no 07-08, I use first) BTW I would pad single digit months with leading 0 to keep a clean sort Multiple passes #1 Replace: Dest series: \1 #2 Replace dest series_index \2.\3 The series is the same as the Magazine the index is YYYY . MM no spaces We CAN NOT clean the title (at least very much) Every entry MUST be different Note For Series Indexes, you need to convert named months to Digits to have them sort in proper order. The title can stay 2009 Nov (Nov 2009) |
|
Advert | |
|
02-02-2023, 09:46 PM | #3 |
Enthusiast
Posts: 30
Karma: 10
Join Date: Aug 2017
Location: USA
Device: Kobo Clara, Pixel 6 (Moon Reader/Calibre Companion), Amazon Fire 10
|
Wow, thank you! With next to no comprehension of what I'm doing, I tried that on two titles and it worked for the series and index. The only downside--and it's hardly one--is that it apparently doesn't work for my quarterlies, which I thought were smartly named "Sp" "Su" "Fa" "Wi"-- but a numeric system makes more sense just from an ordering perspective.
I'm going to go back thru with a regex tutorial site and try to understand it so I don't mess up when I do a (like I said, I really want to understand this, I don't want to have to bug those more knowledgeable; I just have had zero programming opportunities outside of simple macros in Excel and Word). So what about the author field?.... that's the bigger issue for me with these magazines of which I have just one or two, want them in the proper Calibre folder in the system. Again, just want to copy everything before the comma ("Gardens Illustrated"). Also, imagine I should watch out for the ampersand--take it out of the title field entirely before processing? It always does screwy things in my authors field. Truly appreciate your help. |
02-02-2023, 10:07 PM | #4 |
Well trained by Cats
Posts: 30,416
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
To fix your quarterlies
simply replace the (\d{1,2}) with (Sp) and the \3 with 01 <for 1st Month repeat for (Su) 04, (Fa) 07, (Wi) 10 Assumes YYYY Q You are doing a literal replace instead of Capture 3 |
Tags |
bulk edit, copying, fields, reg expressions, regex |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extract author from title field? | srv181 | Library Management | 3 | 10-20-2021 04:46 PM |
Extract Series Number from Title | jpbweb | Library Management | 2 | 11-05-2017 04:07 AM |
adding book : series is part of the whole title | Dragouf | Library Management | 4 | 07-19-2013 12:52 AM |
Two fields for title and series | svetimas | Calibre | 2 | 07-09-2012 01:31 PM |
How to reverse Author and Title Fields | mgsander | Calibre | 3 | 04-21-2012 01:08 PM |