View Single Post
Old 01-30-2014, 06:51 PM   #3
kaufman
Calibre Companion Fanatic
kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.kaufman ought to be getting tired of karma fortunes by now.
 
kaufman's Avatar
 
Posts: 873
Karma: 1088610
Join Date: Nov 2006
Device: Galaxy Note 4, Kindle Voyage
Quote:
Originally Posted by eschwartz View Post
http://manual.calibre-ebook.com/temp...-not-found-val

using str_in_list(val, separator, string, found_val, not_found_val)

use "," as separator, val will be field('tags') and you want to search for string "First", then return found_val "First". not_found_val should return empty "" which first_non_empty should skip over, I think.

Personally, I think you should use general program mode for this:

Code:
program:
	first_non_empty(
		str_in_list(
			field('tags'),
			",",
			"First",
			"First",
			""
		),
		field('series'),
		"Uncategorized"
	)
Thanks, this look very helpful. How do I go about using a program mode?
kaufman is offline   Reply With Quote