Author Topic: search for number of characters in text?  (Read 1891 times)

Offline SAMouzon

  • Member
  • **
  • Posts: 63
    • View Profile
    • The Original Green Blog
search for number of characters in text?
« on: December 04, 2022, 11:15:35 AM »
Is there a way of searching for photos with a keywords or comments field with more than a certain number of characters? What I'm specifically trying to fin right now are pics with a lot of text in the keywords field. I've tried a few things, but nothing works so far. I don't see anything in the online manual or the search examples that say anything about character counts, but wonder if it might be a lesser-known feature.

Also, is the search language something built for Photo Mechanic, or is it an existing language that might have a full manual out there somewhere?

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: search for number of characters in text?
« Reply #1 on: December 05, 2022, 08:57:51 AM »
Is there a way of searching for photos with a keywords or comments field with more than a certain number of characters? What I'm specifically trying to fin right now are pics with a lot of text in the keywords field. I've tried a few things, but nothing works so far. I don't see anything in the online manual or the search examples that say anything about character counts, but wonder if it might be a lesser-known feature.

No, there are no length-based queries.

Also, is the search language something built for Photo Mechanic, or is it an existing language that might have a full manual out there somewhere?

The search language/syntax is unique to Photo Mechanic Plus but is designed to be natural and logical.

https://docs.camerabits.com/support/solutions/articles/48001077445-photo-mechanic-plus-search

HTH,

-Kirk

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 553
    • View Profile
    • Camera Bits
Re: search for number of characters in text?
« Reply #2 on: December 05, 2022, 09:25:47 AM »
Just an FYI, if you were to do a text export of your catalog with the {keywords} {filename} values into a TSV, you can use the LEN() function in Excel or Google Sheets to list the character count of the keywords field.  It might take a few minutes, but if you were just doing it once, it might be doable.

Mick
Mick O
Camera Bits

Offline SAMouzon

  • Member
  • **
  • Posts: 63
    • View Profile
    • The Original Green Blog
Re: search for number of characters in text?
« Reply #3 on: December 05, 2022, 02:40:59 PM »
Got it... thanks, Kirk! And thanks, Mick! Wasn't aware of exports; that could be really useful.

Offline Mick O (Camera Bits)

  • Camera Bits Staff
  • Hero Member
  • *****
  • Posts: 553
    • View Profile
    • Camera Bits
Re: search for number of characters in text?
« Reply #4 on: December 05, 2022, 05:19:51 PM »
I realize the documentation on the Export part is not great, but in brief:

You can run the text exporter by selecting files and then going to File > Export...  and choosing "Text Exporter" from the dropdown.

(To do this for an entire catalog, you can just put "" in the search bar to get a Contact Sheet with your entire catalog, and then use cmd/ctrl-a to select all) 

If your goal is to create a spreadsheet, use {tab} in between {variables} to pick what you want to export from the files that you selected.
In my test I used:

{filename}{tab}{folderpath}{tab}{keywords}

I named the exported file with .tsv as the extension and then opened that in Excel.

One caveat: the text exporter wasn't originally written with millions of files in mind, so I am not sure how it will perform on very large catalogs. The test I just did with 8500 images went fine. It may take some time to chug through larger numbers of files.  I am curious to know how this will do with larger catalogs, and when I rebuild my catalog I will try it. 

Mick


Mick O
Camera Bits