Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 10-14-2022, 07:52 PM   #1
Jobasha
Junior Member
Jobasha began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Nov 2020
Device: Samsung Note 9, Calibre Companion, Moon+ Reader
Searching Library on Field Length

Hi!

I was wondering if it was possible to search the library on the length of a field. For instance:

strlen(comment):<100

or

len(author):>1

Does this functionality exist?


Thanks!
Jobasha is offline   Reply With Quote
Old 10-14-2022, 09:53 PM   #2
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 20,653
Karma: 26966376
Join Date: Mar 2012
Location: Sydney Australia
Device: none
See Search using templates in The search interface

The template language has a number of string functions ==>> Function reference

BR
BetterRed is offline   Reply With Quote
Advert
Old 10-14-2022, 10:00 PM   #3
ownedbycats
Custom User Title
ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.ownedbycats ought to be getting tired of karma fortunes by now.
 
ownedbycats's Avatar
 
Posts: 8,795
Karma: 62032371
Join Date: Oct 2018
Location: Canada
Device: Kobo Libra H2O, formerly Aura HD
It may also be possible with a regex search.
ownedbycats is offline   Reply With Quote
Old 10-15-2022, 06:16 AM   #4
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by ownedbycats View Post
It may also be possible with a regex search.
Yes, it is. Examples:
  • for a title >= 50 characters
    Code:
    title:"~^.{50}"
    The regex says "starting at the beginning of the item (the ^), match if there are 50 or more of any character (the .{50}".
  • for a title < 50 characters
    Code:
    not title:"~^.{50}"
The technique works for multi-value columns like tags and authors, checking each value.
chaley is offline   Reply With Quote
Old 10-15-2022, 08:04 AM   #5
un_pogaz
Chalut o/
un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.un_pogaz understands the importance of being earnest.
 
un_pogaz's Avatar
 
Posts: 411
Karma: 145324
Join Date: Dec 2017
Device: Kobo
{50} alone work only for a text with an exact length of 50 character
for >=50 use {50,}
for <=50 use {,50}
un_pogaz is offline   Reply With Quote
Advert
Old 10-15-2022, 08:12 AM   #6
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 11,774
Karma: 7029857
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by un_pogaz View Post
{50} alone work only for a text with an exact length of 50 character
for >=50 use {50,}
for <=50 use {,50}
No it doesn't. It works if the text is 50 *or more* because there isn't an trailing anchor ($) on the expression. Finding 50 characters doesn't rule out there being 51.

This screen capture shows it working using the expression '^.{5}'
Attached Thumbnails
Click image for larger version

Name:	Clipboard01.png
Views:	62
Size:	25.9 KB
ID:	197173  
chaley is offline   Reply With Quote
Reply

Tags
calibre, functions, length, search, string


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Searching a yes/no field ficbot Calibre 19 11-26-2015 12:44 AM
Is there a limit to the length of the Authors field? Inferno Library Management 4 07-25-2014 05:59 AM
Field length for first filename too long djstormer ePub 3 09-29-2012 08:45 PM
Saved Search field length size Sabardeyn Library Management 1 11-12-2011 09:36 PM
Searching on Ratings Field nynaevelan Calibre 3 05-29-2010 05:44 PM


All times are GMT -4. The time now is 12:26 PM.


MobileRead.com is a privately owned, operated and funded community.