Quote:
Originally Posted by Starson17
I'm not certain I understand you, but I think you want to find books where the comments field has content, but not much content. I suspect you need the len() function. I'm pretty sure you can't do that with search. You might be able to do it by creating a custom column, but a quick check through the functions available didn't turn up len. I suspect we need Charles the guru for this one.
|
The function you are looking for is count. The following template
Code:
program:cmp(count(field('comments'), ' '), 15, 'true', 'true', 'false')
uses count to generate 'true' if comments contains 15 words or less, and 'false' for more than 15. A word is defined as not-spaces separated by spaces.
You could just as easily use
Code:
program:count(field('comments'), ' ')
in a column with sort/search type 'number', then use the search expression
Edit: If you want the basic length, you can use strlen instead of count.