View Single Post
Old 05-27-2025, 05:00 PM   #1049
Reader4106
Member
Reader4106 began at the beginning.
 
Posts: 17
Karma: 10
Join Date: Oct 2014
Location: Schweiz [Switzerland]
Device: Pocketbook Verse Pro
(Translated from German using Google Translate)

I hope I'm in the right place with my question.

I have two custom columns in Calibre. Both are hierarchically structured.
The first column has the following labels:
Lookup name: #genre.
Column heading: Genre.
Normally, only one (comma-separated) value appears. However, there are a few cases with more than one entry.
The first/top level consists of a "sort character" such as _, §, °, , etc., followed by several sublevels, which are separated by "." as usual.

The contents of the second column have the following labels:
Lookup name: #genre_rg.
Column heading: Genre (ReadingGoal).

This should now be created in a "flattened" form from the values ​​of the first column.
By "flattened," I mean the following:
- The sorting level should be filtered out.
- The second and third hierarchy levels should remain.
- The remaining levels should be ignored.
Here are some examples:
_.Belletristik.Roman.Spannung.Krimi.+nl → Belletristik.Roman
§.Sachbuch.Geschichte.Weltgeschichte.Menschheit → Sachbuch.Geschichte
#.Zeitschrift.Geschichte.Kultur.Menschliche → Zeitschrift.Geschichte
≡.Essayistisches.Kurzgeschichten.Reiseessays → Essayistisches.Kurzgeschichten
_.Belletristik.Roman.Cli-Fi, _.Belletristik.Roman.Dystopisch → Belletristik.Roman, Belletristik.Roman
§.Sachbuch.Gesundheit.Lebenshilfe.Beziehung.Sexual ität, Sachbuch.Wissen.Evolution.Mensch/Tier → Sachbuch.Gesundheit, Sachbuch.Wissen
Reader4106 is offline   Reply With Quote