View Single Post
Old 03-15-2019, 04:07 PM   #8
meghane_e
Zealot
meghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercisemeghane_e juggles running chainsaws for a bit of light exercise
 
Posts: 114
Karma: 38500
Join Date: Sep 2016
Location: San Jose, CA
Device: Kindle moving to Kobo or Boox
I used calibredb list -f *genre > "genre_list.txt". The files have a line for each book showing id+buffer+genre. The (id+buffer) was 5 spaces for me but would vary per library.

I ended up writing a python script to strip the id+buffer and and print a comma-separated list of all genres plus an additional comma-separated list with each genre in quotes for use in Calibre template code (might as well).

ex.
List 1: Adventure, Fantasy, Mystery, Romance, Science Fiction
List 2: "Adventure", "Fantasy", "Mystery", "Romance", "Science Fiction"

Happy to share it, although my coding is clunky.

Last edited by meghane_e; 03-15-2019 at 04:07 PM. Reason: verb tense
meghane_e is offline   Reply With Quote