Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 06-15-2014, 12:24 PM   #1
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2013
Device: iPad
How to clear all Identifiers (Ids) except ISBN

I want to just retain ISBNs for the books in my library. Is there a way to "bulk remove" every Identifier except existing ISBNs?
paul55391 is offline   Reply With Quote
Old 06-15-2014, 07:09 PM   #2
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
The only thing that I can think of is:
  1. Open Tag Browser to determine all the identifiers used
  2. Select one identifier at a time to limit affected books
  3. Highlight all
  4. Edit Metadata in Bulk
  5. Search and Replace Tab
  6. Search Mode: Regex
  7. Search Field: identifiers
  8. Search For: [expression, see below]
  9. Replace With: empty
  10. Verify test area results are correct
  11. Apply
I cannot think of the exact regex you would need. Roughly, it would probably be the identifier's name, a colon and then "all characters, greedy, until the next whitespace/word end". So something like... ID:+.? Or is it ID:.+? Hmm.. think I'm missing the word boundary. Anyway, I'm not sure if the expression is written correctly. But hopefully you've got the idea. I imagine that the colon might need to be escaped.

I would definitely suggest trying this on a sample database. Just to make sure that it doesn't harm anything else. Maybe create a new library and then copy various sample books into it, run the regex and see what happens.
Sabardeyn is offline   Reply With Quote
Advert
Old 06-15-2014, 09:21 PM   #3
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,399
Karma: 84711550
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
  1. Select all the books you wish to affect, and open Bulk Metadata Edit. Make sure you are using regex mode.
  2. Search for...
    Code:
    Search field: identifiers
    Identifier type: isbn
    Search for: (.*)
    Replace with: \1
    Destination field: <anything you can spare. I used "comments">
    Apply the edit.
  3. Search for...
    Code:
    Search field: comments
    Search for: (.*)
    Replace with: isbn:\1
    Destination field: identifiers
    Identifier type: *
    Apply the edit.


The reason this works is because, while there is no way to replace an identifier with a subset of itself, you can use * to replace all the identifiers IF AND ONLY IF the search field is not "identifiers". So by temporarily storing the isbn in another field, you can have the isbn overwrite the whole identifiers field.
(I used the comments field, because I used a test book created by importing another book from the same library. )

See screenshots.
Attached Thumbnails
Click image for larger version

Name:	calibre-bulk-delete-identifiers-part-1.jpg
Views:	480
Size:	276.4 KB
ID:	124229   Click image for larger version

Name:	calibre-bulk-delete-identifiers-part-2.jpg
Views:	434
Size:	277.4 KB
ID:	124230  

Last edited by eschwartz; 06-15-2014 at 09:25 PM.
eschwartz is offline   Reply With Quote
Old 06-15-2014, 09:25 PM   #4
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,399
Karma: 84711550
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by Sabardeyn View Post
I cannot think of the exact regex you would need. Roughly, it would probably be the identifier's name, a colon and then "all characters, greedy, until the next whitespace/word end". So something like... ID:+.? Or is it ID:.+? Hmm.. think I'm missing the word boundary. Anyway, I'm not sure if the expression is written correctly. But hopefully you've got the idea. I imagine that the colon might need to be escaped.
When S&Ring the identifiers field, each identifier acts as a self-contained unit. So the regex would be ".*", and replaced with a null value.

Quote:
I would definitely suggest trying this on a sample database. Just to make sure that it doesn't harm anything else. Maybe create a new library and then copy various sample books into it, run the regex and see what happens.
I second the idea of testing this out first, always a good idea when doing Bulk S&R -- with a powerful tool like that, you have room to mess up quite badly.

Last edited by eschwartz; 06-16-2014 at 12:13 PM. Reason: typo
eschwartz is offline   Reply With Quote
Old 06-16-2014, 03:07 AM   #5
chaley
Grumpy old git
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 9,407
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
You can also use the technique described in this thread: https://www.mobileread.com/forums/sho...d.php?t=207433
chaley is offline   Reply With Quote
Advert
Old 06-16-2014, 12:12 PM   #6
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,399
Karma: 84711550
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Quote:
Originally Posted by chaley View Post
You can also use the technique described in this thread: https://www.mobileread.com/forums/sho...d.php?t=207433
Did not realize you can use a template as the search field. That is just really cool.
eschwartz is offline   Reply With Quote
Old 06-16-2014, 12:18 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,399
Karma: 84711550
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
... And yes, apparently I actually answered a question in that thread, and still didn't notice.
eschwartz is offline   Reply With Quote
Old 06-16-2014, 03:36 PM   #8
chaley
Grumpy old git
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 9,407
Karma: 3007492
Join Date: Jan 2010
Location: UK
Device: Reader
Quote:
Originally Posted by eschwartz View Post
Did not realize you can use a template as the search field. That is just really cool.
I added that feature to allow more-or-less arbitrary field values such as setting destination fields to values constructed from other fields. Turns out to have many other uses, including this one (pruning values in multiple fields). It isn't the easiest feature to wrap one's head around, I admit.
chaley is offline   Reply With Quote
Old 06-16-2014, 11:03 PM   #9
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2013
Device: iPad
eschwartz, I learned something from your post (#3), but your method wipes out 'comments', and I already use that field. In fact, there isn't one single field I can unconditionally wipe out. Maybe it's possible to first create a temporary field to store the isbn value (and then throw the temporary field away.) Does this sound like a reasonable approach?
paul55391 is offline   Reply With Quote
Old 06-16-2014, 11:16 PM   #10
BetterRed
null operator
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 16,680
Karma: 19705250
Join Date: Mar 2012
Location: Sydney Australia
Device: none
@paul55391 - IMO that would work, its easy enough to add and delete custom columns and there's a comments like custom column type.

Custom columns are always referenced with a '#' in front of the internal name - so if yours was 'temporary' you would use #temporary instead of comments in eschwartz's post #3.

BR
BetterRed is offline   Reply With Quote
Old 06-17-2014, 01:04 AM   #11
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,399
Karma: 84711550
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
A better way would be to use chaley's method, which I would've recommended if I knew it existed.

Code:
Search field: {template}         (YES! This exists and it is awesome!)
Template: {isbn:|isbn:|}
Search for: (.*)
Replace with: isbn:\1
Destination field: identifiers
	>> Mode: Replace field, Split Result="checked"
Identifier type: *
Template uses isbn # and prepends "isbn:" to it, then feeds that into the replace. No need for a custom column at all. Thanks chaley!!
Attached Thumbnails
Click image for larger version

Name:	calibre-bulk-delete-identifiers.jpg
Views:	362
Size:	279.9 KB
ID:	124269  

Last edited by eschwartz; 06-17-2014 at 01:06 AM.
eschwartz is offline   Reply With Quote
Old 06-17-2014, 10:52 AM   #12
paul55391
Enthusiast
paul55391 began at the beginning.
 
Posts: 36
Karma: 10
Join Date: Aug 2013
Device: iPad
Thanks, that works fine. (I did change the "Replace with" so it agrees with your screen snap:
Replace with: \n
Without this change the string "isbn:" is duplicated.

Thanks a lot. Now that I understand what one can do with regular expressions, I can see this might be very useful in the future as well.
paul55391 is offline   Reply With Quote
Reply

Tags
identifier

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Fragment identifiers frisket ePub 19 04-02-2014 03:44 PM
How to swap title with identifiers:isbn tizboy Library Management 1 06-06-2012 09:48 PM
Modifying Identifiers Fabe Sigil 6 01-11-2012 08:46 AM
Stupid Question: ISBN-10 and ISBN-13 Tegan Library Management 4 03-11-2011 02:20 AM


All times are GMT -4. The time now is 12:52 PM.


MobileRead.com is a privately owned, operated and funded community.