data driven category based on a part of a filename - is this possible?

Started by aki-bs, December 08, 2016, 09:00:21 PM

Previous topic - Next topic

aki-bs

I like to assign files with filenames like yymmdd,hh,mm,ss,nn_pan.jpg to the category "panorama". The trigger for this should be "_pan".
How can I do this with data_driven categories?

Mario

Use the photools.com::IMatch\101100\file.name\0 tag and then use the part of value  option to extract the part of the file name you are interested in.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

aki-bs

Quote from: Mario on December 08, 2016, 09:22:06 PM
Use the photools.com::IMatch\101100\file.name\0 tag and then use the part of value  option to extract the part of the file name you are interested in.

I have tried this out. Sometimes it works fine, sometimes it doesn't work.
Attached you see my configurations. Whats going wrong? What I have to change?


sinus

I think, if you have a consistent name- convention you could use a variable like this:

{File.Name|substr:23,3}

You must only find the correct numbers, but should not be a problem.

I use this variable to find all clients from my filenames:

20160628-0925-293362-s-coo-kirschenernte_m.nef




Best wishes from Switzerland! :-)
Markus

Mario

1. Why do you use a category filter?
You limit the input to this category to files which are in a category named _pan.
This is surely not what you want.

2. You can only with with the "part of value" and cut put parts of your file name if you have a consistent naming schema and all your file names have the same length and layout. if you have file names with different length, this cannot work.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

aki-bs

@sinus; how one can find out the correct number?
@Mario; there are some files, which have longer names. but without setting the filter, I saw in preview the correct names. why should it not work, after setting this filter?

Mario

This filter tells IMatch to consider only files in the _pan category for this data-driven category. If this is what you want, good.

If you work with file names with variable length, you can neither use "part of" or the file name variable. Because if "pan" is in a different spot in your file name all the time, the data-driven category cannot find it when you always look at the same place (using the same offset and length).

You will probably have to cook something else, like

{File.Name|contains:_pan,Panorama,}

This variable returns the word Panorama when the file name contains _pan, else it returns an empty string.

If you now setup a data-driven category based on a variable, it produces two children:

Panorama
Other

PANO contains all files containing _pan in the file name, the Other category contains the rest.
If you don't need other, set the "Use Other" option in the data-driven category configuration to No.

This gives you a data-driven category 'Panorama' with all your panoramas.

One way to do it, if you really want to do it using the file name.

I'm quite sure that such things are not possible in other DAM software.  :)
Spread the word about IMatch.


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

sinus

Quote from: aki-bs on December 09, 2016, 07:36:40 PM
@sinus; how one can find out the correct number?

If you had a consistent naming scheme, you could simply count the wished numbers, like in my case


20160628-0925-293362-s-coo-kirschenernte_m.nef

I want the part coo (client), hence I count from left 23, and there I am interested in 3 letters.
Therefore my variable

{File.Name|substr:23,3}

But I believe now, you have different length, so you should go the way, what Mario proposed, a variable with contains.

This will bring, what you want.



Best wishes from Switzerland! :-)
Markus

aki-bs

Quote from: Mario on December 09, 2016, 08:11:16 PM
You will probably have to cook something else, like

{File.Name|contains:_pan,Panorama,}


That's absolutely great and working fine  :)
I'm getting more and more happy with IM5.

Mario

QuoteI'm getting more and more happy with IM5.

That's cool.

People so often realize how powerful and flexible IMatch is after using it for a while.
Where you run into walls with other software, or they tell you "If our product does not have this feature, you don't need it" (Apple) there is almost always a way to do it with IMatch.

I always struggle to get that over to potential users. The flexibility and openness and adaptability to user's needs.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook