Extracting keywords from a cataloged text file.

Started by rcrigan, April 07, 2023, 07:21:27 AM

Previous topic - Next topic

rcrigan

I would like to assign keywords to a file I've catalogued in IMatch. The file is a text file and I want IMatch to read the contents of this file and assign the contents as keywords. Is this possible?
Thanks for your time. Robert, Australia

Mario

#1
IMatch does not offer such a feature. IMatch does not read text files or analyzes their content in any way.
It reads some metadata for the file into the database and allows you to add keywords, headline, rating etc. like for any other file. If you write-back, IMatch creates an XMP file next to the text file. See Metadata for Beginners in the IMatch help for more information.

Would all words found in the file become keywords? Or only some words? How large is the file and how many words does it contain?

Tip: If this is only needed for a small number of files, you can use this trick:
1. Open the file in Windows Notepad and do a search/replace to replace blanks (spaces) with ;
2. Select everything and press Ctrl+C to copy it into the Windows clipboard
3. Select the text file in a File Window and then click into the input field of the Keywords Panel (where it reads Enter new keywords here...)
4. Press <Ctrl>+<V> to paste the keywords from the clipboard
5. Press <Enter> to add the keywords to the file

The functionality you want is quite uncommon. But IMatch is flexible and extensible.
This task could done with a custom IMatch app or a script written in other programming languages like Python or PowerShell. If you know how to program or you know somebody who does, check out the IMatch Developer documentation.

Basically the script would read the text file, extract the keywords and then store these as hierarchical keywords in the database. From then one, all keyword-related features in IMatch will automatically work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

rcrigan

Thanks Mario. That's a useful tip. I'll try it.