Replacement Expression in Preferences>File Relations

Started by joi, January 26, 2014, 03:12:23 PM

Previous topic - Next topic

joi

Hi
I am slowly getting myself familiarized with the upcoming IMatch5 and must say it is a very promising product!
One thing that confuses me is how the Replacement Expression in Preferences>File Relations works.  As it runs now, all buddy files are always renamed accordingly to the master file, e.g. P1201534.JPG and buddy file P1201534_er.ORF (this is how I define the realationship) always ends up as P1201534.JPG and buddy file P1201534.ORF, i.e. "_er" is stripped out.  IT does not matter what I put, or no not put, in the Replacement Expression.

Is this supposed to work like that or is it a beta thing?

J

Mario

The replacement expression is applied to the source file name only, to handle certain cases described in the help file. It does not affect how buddy files are matched or named.

Please open the Configuring File Relations help topic, open the table of contents at the top and there click on Replacement Expression. Search for Replacement Expressions to find the topic, or press <F1> while in the dialog.

The topic on replacement expressions and when to use them (rarely needed) is quite detailed, with many examples. Too much to repeat here. Holler when you've read that and still have a specific problem.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

joi

Thank you for your reply Mario

I agree that the help on this is quite detailed but I have not been able to get this to work.  The problem may be due to - and I just discovered this - that the settings I put in the "File Relations" Preference do not stick for some reason: if I delete the default "^_*//" and put something else in there, e.g. "^{name}_([a-z|0-9|0-9])*\.(orf|jpg|tif|tiff|dng)$", it does not stick.

The "Apply" button is also greyed out.

Mario

The Apply button is grayed out for all settings which cannot be applied without closing the dialog. These settings will be applied/implemented/loaded/set when you close the Preferences dialog with OK.

Your replacement expression is not correct, it does not follow the

replace this/with that/

schema and hence is not accepted.

Just to understand what you are trying to do:

P1201534.JPG is your master file and
P1201534_er.ORF is your buddy file?

IMatch assumes that the master and the buddy file have the same file name, and different extensions. If you work with buddy files which have a different file name than the master file, the automatic buddy file processing in IMatch will most likely not work. Especially not if the buddy file name contains characters or digits which are not present in the master name.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

joi

This is what I was afraid of.  I do indeed distinguish between master and buddy files using an underscore in the name part.  This is possible in versions 3.x - but I remember you told me a long time ago this 'feature' was not intentional when I had some similar problems.  The reason for this is simple, it makes the master and buddy files easier to spot for me.

BenAW

Try  ^{name}:8\.orf$  or similar for the link expression.

Looks only at the first 8 characters of the filename.

joi

Thank you for the suggestion, I am going to play around with that.

One thing I did not clarify in my first post is that this stripping of the buddy file name happens when I copy the master file followed by the buddy file to another folder.  This happens obviously when I  have a valid expression (tested with the "Test Expressions" utility (e.g. Master Expression = "\.(jpg)$" and Link Expression = "^{name}:8.*\.orf$").

So the file relation is recognized but the buddy file name is always altered in the copying process.