Search for matching file names?

Started by guentergulasch, July 29, 2015, 06:20:43 AM

Previous topic - Next topic

guentergulasch

Does anyone know of a way of searching a complete database for matching file names? In IMatch 3 there was a very efficient and useful script called "File Name Match" which took the  first six characters of one or more files in the thumbnail window and automatically found all other files with names starting with the same six characters.

IMatch 5 doesn't seem to be able to do that. Or am I missing something?

Thanks for any help
Andreas



Ger

Probably the best answer is to use Versions.

Attached a File Name Match script for Im5. The script uses a specific output category, you can change the result category in the first lines in the script.

Ger

[attachment deleted by admin]

Ferdinand

There is the search bar above the file window that can search for file names.  From the drop down you can select "search file names only".

There is the filter panel which has a file name section, although you may have to display this sub-panel, as it may not be displayed by default.

Both of these operate on the current context, i.e. what's in the file window.  So to search the entire DB, you have to select the database node in the media and folders view, or @All in the Categories view.

More details in the help file.

JohnZeman

Attached is a script I wrote a couple years ago that does this.  You select the image(s) you want to find a match for then run the script.  It checks complete file names but not the file extension so raw files will match JPGs providing their file names are otherwise identical.

All matching images are assigned to the FLAG SET collection while all images that had no match are assigned to the FLAG UNSET collection.

Now I'm heading out of town again, this time to photograph a hot air balloon festival.  ;D

[attachment deleted by admin]

guentergulasch

Thanks "Everyone" for your quick replies and your help!

JohnZeman/Ger - Thanks a lot also for your attachments/scripts. They both work fine and are very helpful. Only thing is they seem to "only" find files with exactly matching file names. The IMatch 3 script I mentioned (it actually wasn't called "File Name Match" as I mistakenly said in my post, but rather "File Name Digit Match") also found files with only partially matching file names - if the highlighted file's name was eg "abcd", then it would find all files named "abcd" (with other/different extensions) and also "abcde", "abcd1", "abcd123" etc. That was very practical and extremely useful.

Ger - Yes, versions. But that seems a bit complicated for a quick file name search like IMatch 3 used to be able to do. Versions in IMatch 5 seem to work only on a folder basis, so I would be constantly copying files back and forth to and from Master folders and refreshing relations etc. Or I would have to make all RAW images Masters and all their derivatives versions. Too much hassle, I think, if all I want is files with partially matching file names.

Ferdinand - Yes, I've already discovered the search options you mention. But I find them rather tedious. You always have to go to the @All category first and then after the search your have to click your way back to the folder or category you were working on. That can result in a lot of time-consuming "clicking". And also you have to manually type in each file name or part of a file name individually - which is even more time-consuming, when you're looking for 10 or 15 files/file names. In IMatch 3 all that wasn't necessary. Copy and paste doesn't do the job here either because Ctrl+C always gives you the complete file path(s) and not just the file name(s).

All in all I'm very happy with IMatch 5 so far (only been using it for a couple of weeks), but it's a pity that it has apparently lost a couple of functions that the predecessor used to have. Ah well, c'est la vie, I suppose ... :-)

Thanks again to you all and best regards
Andreas


Ferdinand

I have a half-written script that would make searching easier.  I was waiting for some new scripting methods which I needed in order to finish it..  I think they were in included in a recent release, so I'll try to find the time to finish it off.  May be of interest.  Keep an eye out for it.

Mario

If you are so dependent on a user-written script, why not port the script to IMatch 5? If you cannot write scripts yourself, ask the original author of the script if he wants to port it. As it has shown, most of the scripts written for IMatch 3 are no longer needed in IMatch 5, because IMatch 5 has so many new features.

Versioning works across all folders, if you configure it so. You can easily choose where to look for versions. But I don't think your specific search pattern is related to file versioning.

If none of the advanced filter and search functions in IMatch 5 can do what you need, your search requirements are very peculiar and may only be manageable by a purpose-built script.

The File Name Filter supports regular expressions, so it can easily handle the "abc*" search you use as an example. A filter like ^abc finds all file names in the current scope which start with abc, Even the simple starts with filter mode is probably all you'll need.

Instead of searching via the @All category you can just use the Database node in the Media & Folders View to search the entire database. The folder history control in the Media & Folder toolbar allows you to go back to your last folder with a single click.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

guentergulasch

No, Mario, I can't write scripts myself. But if asked the original author to port it, I would have to ask you because you're the original author. The script I mean (File Name Digit Match) didn't really do anything "very peculiar", it was rather included in IMatch 3 as an everyday standard it seems and it was installed by default - and it was just excellent. For clarity's sake and for your information I'll attach the script's bai-file; that should make it more understandable what I'm talking about.

All the other things you suggest don't do the job for various reasons, ie functions the said script had, but which are missing in IMatch 5 (see my previous post).

Ferdinand - Okay, thanks for the info (and in advance for all the work you're doubtlessly putting into writing scripts and offering them to us users to boot!). I'll keep my eyes peeled.

Cheers
Andreas

PS: Just got an error message telling me that only certain file types can be uploaded. Will try again with bai-file zipped. Hope it works.

PPS: The zip file didn't go through either. Here are the text contents of the bai file:
---

Name=File Name Match

Author=Written by Mario M. Westphal

Copyright=Copyright © 1999-2001 Mario M. Westphal

Description=This script performs a file name based match. \n\nIt takes the first 6 characters of the selected file(s) in the thumbnail window and finds all other images with file names that start with the same characters.\n\nThe results of the match are added to the category 'XResult'.\n

Category=Specials


Mario

#8
Ah, a script I wrote 14 years ago  ;)  Sorry, didn't remember this. And by the looks of it is has been written for a very specific purpose. It's even in the Special category, which is for user-requested scripts. I doubt that this script is used by many users. Maybe by you only.

If you want me to port this script to IMatch 5, please add a feature request in the Feature Request board. This allows us to see if other users also want this script ported and how many. It should not take long to port this script but I'd rather work on features which are of use for more than one user.

PS.: I also offer IMatch consulting and custom scripting for moderate hourly rates. If you are interested, contact me via my support email (see link below).

-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ColinIM

Quote from: Mario on August 02, 2015, 09:05:38 AM
(....) I doubt that this script is used by many users. Maybe by you only.

(My added emphasis.)

Hmmmm! I wonder if that was so ....

I was also a regular user of that script in IMatch 3 ... and I note with interest that more than one of our most prolific script-contributers wrote scripts with similar or comparable or 'related' search functionality.  In my humble opinion this suggests that that quick-and-ready search 'option' was rated as 'very worthwhile' ... and therefore - I would deduce - it was probably used by many IMatch 3 Users(?)

Yours warmly and respectfully,
Colin P.

Mario

Then the Feature Request board would be the best place to ask for this. Other users can like the request to make it more important and move it up the queue.

Since IMatch 5 is around for 2 years (with the Beta phase) and I don't recall a request for this script, or even a mention of it in a post, I assumed it was not used by many users.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

Ger

I was a regular user of the IM3 File Name Match script. I regularly use the ported version in IM5; as I do have a convention for file name, this version suits my needs.
I however, like Colin, recognize the need to sometimes quickly find these type of files.

Mario

I have quickly ported the File Name Digit Match script. It will be included in the next release.
If you want it now, extract the attached files into

C:\ProgramData\photools.com\IMatch5\scripts\system\Utility

on your system.

[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

ColinIM

Thank you Mario!!

This is useful for me because (i) I routinely modify the names of my files in various (semi-structured) ways to indicate their 'edited' history, and (ii) I don't (yet) use IMatch's Version scheme anywhere, but in addition (and happily for me in this context) (iii) I usually retain the initial / original 8-characters of the 'out of camera' filenames, which 'allows' this quick, n-character search to work so well here.

I've assigned the F8+F hot-key sequence to this 'early version' of this script (which I have copied for now into my Script Manager / User area) and I'll be sure to make the necessary adjustment - if any - when the 'IMatch incorporated' version of the script arrives in the next release.

I've set myself an exercise for some later date to adapt this neat little script to take another search parameter, namely to search for filenames with matching 'n' characters (as it does already) but starting at a character position in the filename other than the first character.  (Taking care to test for sensible start and end values etc..)  A nice little programming challenge I think.

(Admittedly such a script adaptation could soon become a pointless 'wheel reinvention', given the power of Regular Expressions and IMatch's existing Search features, but sometimes it's a pleasure simply to 'tweak' some code in an already familiar 'Environment' (meaning IMatch's powerful Script Manager)  ;D   Too often my attempts to recall Regular Expression syntax are an uncomfortable reminder that I've already had my "three score years" ... even though I feel more like "40 going on 60"!!)

Colin P.

Aubrey

Quote from: Mario on August 06, 2015, 02:25:27 PM
I have quickly ported the File Name Digit Match script. It will be included in the next release.

It sounds like we'll be getting version 5.4.18 soonish.

I was hoping next release might well be 5.5 !The teaser sent a few weeks ago has me waiting impatiently!

Aubrey

sinus

Quote from: ColinIM on August 06, 2015, 10:31:15 PM
Thank you Mario!!

This is useful for me because (i) I routinely modify the names of my files in various (semi-structured) ways to indicate their 'edited' history, and (ii) I don't (yet) use IMatch's Version scheme anywhere, but in addition (and happily for me in this context) (iii) I usually retain the initial / original 8-characters of the 'out of camera' filenames, which 'allows' this quick, n-character search to work so well here.

BTW/OT: has this "way of writing", this (ii) and so on a (scientific) name? I ask, because it looks so sophisticated, but for me, I am sorry,  :-[ it is not very understandable.  :-[

Quote from: ColinIM on August 06, 2015, 10:31:15 PM
I've set myself an exercise for some later date to adapt this neat little script to take another search parameter, namely to search for filenames with matching 'n' characters (as it does already) but starting at a character position in the filename other than the first character.  (Taking care to test for sensible start and end values etc..)  A nice little programming challenge I think.

Yes, a good enhancement, and I guess, an easy one to do so. I have created for me since a long time an own script for searching, specialy because I like to search also the whole DB, and I like to clicking simply on some buttons and let run the search. Although IMatch itself has a lot of search - possibilities.
Best wishes from Switzerland! :-)
Markus

ColinIM

Quote from: sinus on August 07, 2015, 08:01:25 AM
BTW/OT: has this "way of writing", this (ii) and so on a (scientific) name? I ask, because it looks so sophisticated, but for me, I am sorry,  :-[ it is not very understandable.

Ah! I'm sorry Markus!

(Dwelling Off-Topic ...)
In fact I was trying not to appear too sophisticated  :o :P :)

I actually thought that the Roman numerals (i) (ii) etc. would be more widely recognisable as being "prefixes to an in-line list of items", and that they would be more quickly recognisable while the reader was scanning my hasty blurb than the other common alternative of using (a) (b) and (c) etc.!!!!

Ideally of course, rather than choosing to write my three points in-line, I should really have separated them onto their own lines, even if doing so would have added that hint of undue sophistication that I'd hoped to avoid in a quick reply ...

(i) ...
(ii) ...
(iii) ...

or

(a) ...
(b) ...
(c) ...

I do accept your good point  :) and in future I'll try harder to remember that 'clarity' matters more than 'brevity'  :)

Best regards,
Colin P.

Ferdinand


ColinIM


guentergulasch

Mario: Thank you very (very, very) much for the new version of the File Name Digit Match script! It's great and works very well, just like in the good old days, but with the added luxury of allowing you to freely choose the number of characters you want to search for. I'm "begeistert". :-)

Sorry for the late response, by the way. I was away for a couple of weeks.

Andreas

sinus

Thanks, Ferdinand, for your script!

And Colin, thanks also for your interesting answer, I hope, you was not disapointed from my posting, the fault is basically not yours  :) it is mine, sophisticated users did knew, what you mean, I think.  :D

A good day for all! It's friday, well, the weekend with work is ahead for me. :o
Best wishes from Switzerland! :-)
Markus