View Single Post
Old 06-09-2021, 07:28 PM   #1
lairdb
dog ear
lairdb began at the beginning.
 
Posts: 53
Karma: 12
Join Date: Jan 2012
Device: lots
list of ISBNs in text file; add OR set metadata via calibredb?

Ugh. I have a library reconciliation problem, and I'm not sure how to approach it.

(Environment is Windows 10; only one calibre library is in play.)

(Background: I am giving away about 3,000 paper books; I have previously recorded some of them into Calibre rows, but I'm not sure I've caught all of them, and I'd like to track what I've given away. I can barcode scan them as I box them.)

Scanning them in batches yields a text file of ISBN13s. (I can batch convert these to ISBN10s if needed.)


1) Some of those books are already in my Calibre library -- if they are, then their matching ISBN10 is in a custom column #PaperISBN. For those, I just want to add a tag.

I could do that by iterating through the file and using
Code:
calibredb search #paperisbn:0935526781
to find them -- but it's not obvious how to pipeline the search result to calibredb set_metadata.


2) If they are not in my library, I want to add them, set the tag, and set the #PaperISBN to the correct value.

I think I can do most of 2 with
Code:
 calibredb add --empty --isbn 0935526781 --tag newtag
...but that doesn't prevent duplicates and there's no way to set the custom field in add.

I could work around the custom field by using the GUI to select all tag:newtag and use metadata search/replace to copy the ISBN into #PaperISBN. (But that seems awkward.)

Help? Thanks.

Last edited by lairdb; 06-09-2021 at 07:30 PM. Reason: typos, clarification
lairdb is offline   Reply With Quote