Can one use the |contains:n,true,false function with Renamer Group by function?

Started by Damit, March 21, 2025, 04:27:41 PM

Previous topic - Next topic

Damit

I was trying to use renamer to to only group file names if they contained a open parenthesis in the file name. I tried using {File.Name|contains:(,true,false}, as can be used in the "Don't rename when this variable returns true" but it did not work.

I assume it cannot be used, but I thought I would verify. If not, is there a way to get the renamer to group files when renaming if the file name contain a certain value?

thrinn

If you use {File.Name|contains:(,true,false} with "Don't rename when this variable returns true" the file will be not renamed if the name contains a parenthesis. To have it the other way round, just switch true and false:
{File.Name|contains:(,false,true}
Thorsten
Win 10 / 64, IMatch 2018, IMA

Damit

Thanks again, Thorsten, for you continued help with my travails! You are really earning your "Super Hero" title! ;D

Anyhow, yes, I can see how that would work with the "Don't rename..." function, but I tried and it did not work with the "Group By" function. I think this function may not work with the Group by function.

Mario

QuoteI was trying to use renamer to to only group file names if they contained a open parenthesis in the file name.
How would that be supposed to work?

You cannot prevent a file from being grouped, you can only impact what part of the file name or variable is used. A file name has either a ( (group A) or not (group B). If you return true|false or A|B or Beach|Sky from your variable does not matter. All files with the same value will be grouped together.

Looking at all your posts from the last days, I can only repeat my recommendation I have you initially - the file naming schema you are trying to set up seems overly complicated, fragile and required too many "hacks" like variable-based grouping to make it work. This is never good - many IMatch users have shot themselves in their foot big-time over the years, before setting to a simpler naming convention and put metadata where it belongs - into metadata.

Even when you somehow manage to make it work in IMatch, with it's tons of features, you most likely cannot make it work in Windows Explorer or Finder or other software.

You can of course do what you want and you probably have reasons - but I urge you to think this over and settle on the simplest possible variant.


Damit

I'm trying to simplify Mario. I wish I could go with something simpler and I have racked my brain to consider every option and their caveats. I know from the outside some or perhaps all of this does not make sense, but I am writing it all down and will post my reasoning once I decide on a protocol.

TO answer your question, after reading and testing, it seems I cannot do what I wanted with the group function.

I have a bunch of files that I have edited.  They are in this format: filename.ext, for unedited files and
filename(edit info)-and maybe a description.ext, for edited files

I wanted the renamer to assign the same global sequence number to both, though a file relations-like mechanism. Since the editing information will always change, each file would still have a unique file name, even though the global sequence number is the same.  That way I could group all variations of the original photo by the sequence number, which I planned to place at the end of the string.

So I could have
1926-06-17.c.ym-NG001.P.135.2.4''x3''@600dpi-100000xl.000001.jpg
1926-06-17.c.ym-NG001.P.135.2.4''x3''@600dpi-100000xl(c1.4,e01[mult]_MJS).000001.jpg
1926-06-17.c.ym-NG001.P.135.2.4''x3''@600dpi-100000xl(c1.4,fe05[mult]_MJS)Pepin en New York.000001.jpg

and I could search for all variations of this across my database by searching for the sequence number.

I now have to figure out how to do this without entering the same global sequence number to each variation manually, as there are thousands of these sets already, where everything before the parenthesis is the same. I really want to use global sequence numbers but it may not be feasible if I have to enter them manually.

PandDLong


If I understand correctly you want to identify related files by having the same last 6 characters of the file name (which you plan to populate by the global sequence number). 

I achieved something similar but I did use IMatch File Relations to help me.  Some info, that or may not helpful:

If you use File Relations than you don't need to search through the database as a simple click or two and all related files are put into a Results File Window (or the Version Panel if you prefer).

If you want these relations to be visible from outside of IMatch in Windows Explorer (which was my goal), then the propagation feature of File Relations can help automate this.  I did not use Global Sequence Numbers - which may make it easier or harder - I am not sure.

What I did (and there is probably room for improvement/simplification but this is "Version 1" of the approach that I have used for a few hundred files), I have two renamer presets.  One for Non-Versions and one for Versions - I use the built-in filter in each to prevent it accidentally being used for the wrong type of file.

The process of naming a selection of files is:

  • Run the renamer for the Non-Version files (in your case this would apply the global sequence number)
  • Do a write-back of these files so the propagation rules are applied and this when the version files have a metadata tag populated with the "unique" portion of the file name of the Master file
  • Run the renamer for the Version files - where the metadata tag is used in the file name (and not the global sequence number).

Most of my files do not have master/version relations, so my primary Renamer is purposefully for Masters and files with no relationships.  If I am doing a larger batch of files and I am not sure if there any versions - I might do a filter before each renamer "run" but usually I just rely on the built-in filter.

Using the Relations capability of IMatch was the only way I found to have a Master file share part of its file name with its versions.   I had previously not used Relations but now that I have, I am finding it an increasingly valuable capability and quite glad I went this route.

Michael

Damit

Thank you so much, Michael. I really appreciate your input. It is very helpful. That is exactly what I'm trying to accomplish. I figured something like your system was possible and was inching in a direction that would lead me to a solution similar to yours. But I was getting lost in the woods a bit. I'm glad I'm not alone. I'm going to try to figure out how to do this with regular expressions and versioning. I got pretty complex with my versioning last year but then left it alone and haven't touched it, so I'm going back to square one. I guess I have too many things I'm juggling. For now, so I can continue scanning, I'm just going to put different pieces of information within placeholders in the file name, so I can use regular expressions and the renamer tool to manipulate them rather easily. I just need to confirm that this will be possible, so I can continue working and figure this all out as I go. Back to the manual I go!😀