![]() |
#1 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2023
Device: Kindle
|
![]()
OK, i have messed up my library pretty badly and need some help please.
I had used both import list and jobspy before to upload metadata from a csv to a custom field so thought I could plough ahead without a backup of my library. However, it seems that while this is a fairly easy process for custom fields, it is not so easy for standard, in-built, fields like Identifiers. I created a catalog with my ID's so I could work on them outside of calibre, but now I am ready to re-import them, i am stuck. Import list plugin is a no go as it only works with custom fields. Jobspy says it can do it, but i spent half a day getting my csv into what i believe is the correct format - 'type':'value' separated by commas, but I cannot get it to work. I have now imported the ID's to a custom field - #identifierimport - and looking for a way to simply copy the data from this field into the identifier field verbatim. This can be achieved one by one without any problem, but can someone please either tell me how to do this for my entire library or write a REGEX that accomplishes this in the search and replace function. To clarify, I simply want to copy the exact data from a custom column to the Identifier field. I have over 10,000 books and can't face going one by one. Thanks for any help provided. |
![]() |
![]() |
![]() |
#2 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,671
Karma: 58985420
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
Are yo using Bulk mode S&R in the MDE? That can be used to copy to another column.
My example is the reverse of your task . BACKUP before you try (or use a copy till you get it right ![]() |
![]() |
![]() |
![]() |
#3 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,671
Karma: 58985420
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
![]() Code:
isbn:\1 |
![]() |
![]() |
![]() |
#4 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2023
Device: Kindle
|
I just replied, but it seems to have disappeared...
Firstly, thank you very much for coming back to me, i really appreciate the help. I tried both ways and unfortunately i am not getting the correct result. I have multiple ID's in the identifier field per book and I am seeing 2 issues. Firstly, when the copy is made, it is removing the commas separating each value, which renders them useless. Secondly, with the first REGEX it doesn't bring through the second identifier and with the second REGEX it brings them through (again with no commas) but also adds extra isbn: prefix to the string. I have attached some images so you can see what i mean. Thanks again, if you could take another look, i would appreciate it. |
![]() |
![]() |
![]() |
#5 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,671
Karma: 58985420
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
|
image 2 is (now) malformed (run together as a single identifier).
I assumed you had just one. ![]() If you are doing multiples, the wild card needs to be tamed and the commas put back as you append to existing. ideas only, not even close to being tested: (.+?),{,2} <<<Second group capture. Note having the comma will not grab the last . you need to match the End of the string ,\2 <<<might be \1 because of the count |
![]() |
![]() |
![]() |
#6 |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Aug 2023
Device: Kindle
|
My replies are not showing for me, so forgive me if this comes up 5 times...
Thanks for coming back to me. I am not at all experienced with REGEX, so some of your language is a little confusing for me. I have just tried the following: Search for: (.+?),{,2} when you say i need to match the end of the string, does that mean i need to change {,2} to {,?} where ? is however many different types of id's i have? i.e. if i have 4 id's the regex would be - (.+?),{,4} or i need to add an additional expressions for each additional ID - i.e. if i had 4 id's to copy over the full regex would be: (.+?),{,2},{,3},{,4} Replace with: ,\2 - doesnt work - says 'no such group' \2 - doesnt work - says 'no such group' \1 - doens't put the commas in ,\1 - puts a comma after every character in the test results, but actually does the same as \1 - it copies over the data but without the commas I thought there would just be a simple copy everything exactly as it is in the source field, but alas, that doesn't seem to be the case. I really appreciate you working on this with me, if you have any other ideas, i will certainly try them... While i am at it, you don't happen to know if there is an expression that will alphabetise a field? For instance, if my Identifier field were all in the same alphabetical order, it might make my life a little easier if i have to manually add this stuff back e.g: google:Kh4Etd_swwkC,isbn:9780822211266,amazon:0822 211262,goodreads:2403970 would become amazon:0822211262, goodreads:2403970, google:Kh4Etd_swwkC, isbn:9780822211266 Thanks again |
![]() |
![]() |
![]() |
Tags |
bulk, calibre, identifiers, metadata, regex |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bulk editing identifier not working | nzvengeance | Library Management | 1 | 09-15-2024 03:49 AM |
Bulk-copying identifier values | tn4w | Calibre | 3 | 12-28-2022 03:18 AM |
How to regex bulk update the Title column from another column? | halloleo | Library Management | 10 | 04-16-2021 03:27 AM |
Identifier field buggered | kevincjp | Library Management | 2 | 03-07-2020 06:27 PM |
Bulk-add identifier | khonshu | Library Management | 6 | 07-21-2017 12:10 AM |