how to fix a specific formula-category

Started by Robvog, June 03, 2020, 05:23:26 PM

Previous topic - Next topic

Robvog

I have a folder with only .dng files, the most, not all, having a .jpg alias in another folder (even a another disk). Ignoring the extension, the name of each dng/jpg duo is always exact the same. Each jpg-file is assigned to one or more categories, none of the .dng is.

I want make a category witch shows all photographs that are in .dng but are not in .jpg;
I tried to fix it with a formula-category, but I do not know how to fix that.
Can anybody find a solution fot this question? Be it via a category or be it via anything else.

JohnZeman

Maybe something like this for a formula category?

"@Folder[file://D:/Mine/Photos/Years/2020-2029/2020/]" AND "@FileRegExp[\.dng$]"

bekesizl

If it is a one time only action, then I usually do such things in Excel, if you own it and can use the IF function.

In a command line navigate to the directory and type
dir *.*>list.txt
Do this for both directories.

Open the text files in Excel and copy them in two columns.
Sort them by name and delete the extension (search&replace).

Now you can create a formula with IF, check if the name in the two rows is the same.
If not, you found a difference. Insert rows manually to that column until the names are the same and redo the formula.

After you are through, you can use Autofilter to get the list of the files contained only in one folder.

I like formulas, but for one off jobs this is a quicker and easier way.

Jingo

#3
Personally - I would use software that is made for this type of thing - like freeware directory compare applications.   Beyond Compare or WinMerge can be used to quickly get a list of differences between 2 directories using filters to ignore the extension and even merge or create new directories with the differences automatically.

herman

A different approach: use versions.

Define DNG as master, JPG as version.

Use a first filter to show only DNG files.

Use a second filter to find all master files and invert that filter.

Did not try this, but I think it should work.
Enjoy!

Herman.

JohnZeman

I realize now that I misread Robvog's original question, disregard my previous answer.

So I'll try again.
Are you using versioning?
Seems like that would give you a way to solve the problem.
Establish your versions in preferences then write a formula category to detect the masters without versions.

Below is the category formula I use to detect all masters (DNGs, TIFs, CR2s) that do not have a JPG version.

"@RFolder[file://D:/Mine/Photos/Years/]" AND ("@FileRegExp[\.dng$]" OR "@FileRegExp[\.tif$]" OR "@FileRegExp[\.cr2$]") NOT "@Collection[Relations|Master]"

Ah, Herman just beat me to this possible solution!   ;)

Robvog

I like the the idea of versions, however I never used versions,
Ill give it a try. Thanks for your suggestions!

ubacher

Versioning is the obvious answer.

You say, about your jpg files:
Quote,,,having a .jpg alias in another folder (even a another disk)

Please be aware that there are performance penalties when master and version are "far" apart i.e. not in same folder or
on sub/super folders.


Mario

Quote from: ubacher on June 07, 2020, 04:09:34 PM
Versioning is the obvious answer.

You say, about your jpg files:
Quote,,,having a .jpg alias in another folder (even a another disk)

Please be aware that there are performance penalties when master and version are "far" apart i.e. not in same folder or
on sub/super folders.

This is not true.
The performance of version detection depends only on how many files/folders IMatch has to search to detect versions for a specific master.
If only one folder needs to be searched to find versions for a master (e.g. the same folder containing the master, or a sub-folder of that folder), things will be quick. Whether that folder is on the same drive as the master or on another drive. If the folder to be searched is on a remote NAS, it of course will be slower than searching a folder on a local SSD.

Sometimes users use a too broad or deep search scope, like making IMatch search entire folder hierarchies with dozens of folders and tens of thousands of files. This will slow slow down IMatch.
Sometimes users make IMatch search the entire database for versions for each new master found. This is the slowest possible situation and definitely to be avoided.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook