Category to order photos with wrong date

Started by javiavid, April 13, 2021, 06:10:37 PM

Previous topic - Next topic

javiavid

I would like to create a category that shows the files in which the creation date can not match the year of the folder in which they are contained.

An example:

Full Name:      D: \ Photos \ 2016 \ Capture \ 2016-05-04 05.08.02.png
Create Date:   04/11/2021 21:08:20

My idea was to extract the year from the folder with:
{File.Fullname | contains: \ 2016 \, 2016}

And the year of creation with:
{File.datetime | format:YYYY}

Compare both and if they are not equal to be displayed in the category.

I'm not very clear how to do it, I also would like not to have to include every year with Contains (Maybe a regex?)


Mario

Tricky. You would have to create a variable-based data-driven category for each year, unless you can somehow extract the year with a substr.
That would require that you have a strict naming convention for folders so the year is always at the same place. You need to figure that out.

Note that in variables, blanks and case is significant (your variables did not work because you used the wrong case).

This expression returns either Same or Different, depending on whether the folder "year" (2016) and DateTime match.

{File.FullName|contains:2016,2016;is:{File.DateTime|format:YYYY},Same,Different}

Using this for a data-driven category produces two children. One for the files where the date matches and one for files where the date does not match.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

javiavid

Is there any way to use a regex to extract the year from the folder?

With the regex [0-9]{4}\\ I get 2016\ if I then use is:{File.DateTime|format:YYYY\},Same,Different} it should work.

But I don't know if it's possible to do this, I don't understand very well how to use the regex of the variables.

Mario

If I can ask you to search the Variables help topic for regexp, you will see which variable functions are available for regular expressions.
If something is not documented there, it is not supported. This should answer your question, I believe.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

javiavid

Sorry I insisted, I was trying with filter:Regexp options but I didn't get what I wanted. I thought it was because I wasn't using it correctly.

Thanks for your help