View Single Post
Old 03-07-2019, 03:01 PM   #1
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
building a genre custom column from tags

I'm trying to use the tags that get automatically imported to build my #genre column based on other columns (tags). It's slow going, but with over 8000 books and over a couple of dozen new ones added each week, worth it to figure out. But I'm stuck on a couple of things. First is a regex question at the bottom. Second, is there a known/better way for setting up a #genre column already? There was a plugin (DeriveGenre) that's no longer up.

So my custom column is set up like this right now:
Code:
program: 
build_genre = list_re_group(field('tag'), ', ', '', '(.*)romance(.*)', '', 'Love & Romance ', ''); 
build_genre = list_re_group(build_genre, ', ', '', '(.*)fantasy(.*)', '', 'Fantasy ', ''); 
build_genre = list_re_group(build_genre, ', ', '', '(.*)crime(.*)|(.*)mystery(.*)', '', 'Crime & Mystery ', '')
One of my tags is "Private Investigators (1+)" so I
I tried in build_genre = list_re_group(build_genre, ', ', '', '(.*)investigat(.*)', '', 'Crime & Mystery ', '')
but it doesn't like that. When I switched it to build_genre = list_re_group(build_genre, ', ', '', '(.*)privat(.*)', '', 'Crime & Mystery ', '') it did take it. I tried '^(.*)investigat(.*)' and a couple of other things but still not getting it.
Thank you in advanced!
meghane_e is offline   Reply With Quote