View Single Post
Old 01-29-2015, 10:00 PM   #10
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,590
Karma: 28548962
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
If I were you, I'd write a simple script to do it with calibredb, like this, in bash like code:

Code:
for filename, attachment_id in filenames:
   book_id=$(calibredb add filename | grep 'Added book ids:' | cut -d: -f2 | cut -d' ' -f2)
   calibredb set_metadata book_id --field identifiers:mobileread:attachment_id
It can be easily changed to whatever programming language you like. And you can set any custom columns like this as well, use

calibredb set_metadata --list-fields

to get their names.

You can even create the custom columns using calibredb, if you dont want to involve the GUI at all.
kovidgoyal is offline   Reply With Quote