When grouping files by the default scheme, using a file's modification/creation date, this gives the following output:
Using an evaluator group, you can do similar things and some more.
In this example, there are files which contain the word "ERROR" in their filename. Those specific files should get their own group, still respecting the modification/creation date grouping scheme.
To get this task solved, you have got to use static evaluator groups.
The definition is as below.
Additionally, set up some columns to which this new scheme is restricted to.
For convenience, you can copy and paste the code below.
The main part is about comparing the current date with the built-in variable value . This variable contains the date, either the modification or creation date of a single file during it's processing.
Hence, we have restricted the new grouping scheme to the four columns above. This ensures that no other value hits the code during execution.
The comparison result defines the group value (1,3,5,7), see static values in screenshot above.
You may notice below, that if a file contains the word ERROR, the result is always incremented by 1. In this case, the initial result value becomes: 2,4,6,8 (that is a group name with addition (with error).
If none of the comparisons is hit, the return value is always 9. This is the group name A long time ago. There is no error processing for appropriate filenames in this case.
if (is_dir) { return };
result = 9;
if ( DateDiff("d", Now(), value) == 0 ) { result = 1; }
elseif( DateDiff("ww", Now(), value) == -1 ) { result = 3 }
elseif( DateDiff("m", Now(), value) == -1 ) { result = 5 }
elseif( DateDiff("yyyy", Now(), value) == -1 ) { result = 7 };
if (RegExS( name, "(.*)_ERROR(.*)" ) and result < 9) {
result += 1;
};
return(result);
To use this new scheme, you have to use e.g. folder format and configure the grouping appropriate.
The final result looks like:
Hope, this example is useful for anybody else or at least for some self teaching purposes.