Using modified ExifTool fields to generate Output folder paths

Advanced Renamer forum
#1 : 31/01-17 04:58
Neville Palmer
Neville Palmer
Posts: 3
I would like to use the ExifTool field <ExifTool:DateTimeOriginal> to define my output folder paths. I would like the path to be in the following format:


By using the following pattern;
I am only able to acheive the following format;

C:\basedir\YYYY_MM_DD hh_mm_ss\

I want to be able to remove the time , underscores and space from this and add an additional subdirectory "YYYY" also.

As far as I have been able to determine, this is not possible. Please correct me if I am wrong.

With the standard dates I would be able to use <Year>, <Month>, <Day> fields but these are not available for the ExifTool date-time fields.

When using the ExifTool fields for renaming files I am able to work around this by adding the ExifTool field and then using a "replace" method with regular expressions to remove/extract the relevant string info. This method is not available when defining the output folder pattern.

I thought it might have been possible to prepend the subfolder paths to the beginning of the generated file name instead of defining it in the output folder but this gives the error that "\" is not supported in filenames. This might be a potential workaround if this could be allowed in future versions.

Another possibility might be to include a method list for generating the output folder in a similar way that the method list is used for renaming files.

Another option could be to provide for some form of "replace" rule when adding an ExifTool field.

Please let me know if I am off track and there is already and existing method for producing what I am trying to achieve.


31/01-17 04:58
#2 : 31/01-17 05:06
Neville Palmer
Neville Palmer
Posts: 3
As additional info this is a copy of the contents of my (invalid) .aren file that would prepend subfolders to the beginning of my file name. This should work for any raw or jpg camera files.

An example of a possible resulting file name would be;

application=Advanced Renamer 3.73


method0000=methodname:"newname"; active:"1"; mask:"<ExifTool:SubSecDateTimeOriginal>"; applyto:"name";
method0001=methodname:"replace"; active:"1"; replace:"\d{4}_\d{2}_\d{2} \d{2}_\d{2}_\d{2}(\.\d{2})\d*"; replacewith:"$1"; casesensitive:"0"; regularexpressions:"1"; applyto:"name"; occurrence:"0";
method0002=methodname:"add"; active:"1"; position:"1"; add:"<ExifTool:DateTimeOriginal>"; backwards:"0"; applyto:"name"; regularexpressions:"0";
method0003=methodname:"replace"; active:"1"; replace:"(\d{4})_(\d{2})_(\d{2}) (\d{2})_(\d{2})_(\d{2})"; replacewith:"$1\\$1$2$3\\$1$2$3-$4$5$6"; casesensitive:"0"; regularexpressions:"1"; applyto:"name"; occurrence:"0";
method0004=methodname:"add"; active:"1"; position:"0"; add:"_<ExifTool:Model>"; backwards:"1"; applyto:"name"; regularexpressions:"0";
method0005=methodname:"replace"; active:"1"; replace:"(_).* "; replacewith:"$1"; casesensitive:"0"; regularexpressions:"1"; applyto:"name"; occurrence:"0";

31/01-17 05:06
#3 : 31/01-17 06:12
Neville Palmer
Neville Palmer
Posts: 3
I can now see one work around that will work for me.

If I initially rename the files in place and include the <ExifTool:DateTimeOriginal> values in the new filename I can then run a second batch that does not rename the files but uses the <Substr
:POS:COUNT:START> tag to generate the correct output folder names from the new file names.

This obviously only works because my new filenames contain the required text to generate the folder names.

As an extension of this would it be possible to extend the <Substr> tag to allow an optional text string or another tag to be used in place of a filename?


In use this could look something like;
<Substr:1:4::"2017_01_25 21_22_57">
would return

I'm just thinking out loud now, but how about some form of regular expression tag. That could be extremely powerful.

Something like;
<Regex Replace:(\d{4})_(\d{2})_(\d{2}) (\d{2})_(\d{2})_(\d{2}):$1$2$3-$4$5$6:<ExifTool:DateTimeOriginal>>
would return;

Sorry. My posts here have ended up a little TL;DR. I hope there are some useful suggestions for future releases.

I would really like to see something along the lines of a Regex tag that will accept other tags as input.


31/01-17 06:12
#4 : 31/01-17 06:15
G. Lambany
G. Lambany
Posts: 187
Reply to #2:
Instead of using <ExifTool:DateTimeOriginal>, use the fields <Img Year> <Img Month> and <Img Day> in the destination folder, like so:

c:\basedir\<Img Year>\<Img Year><Img Month><Img Day>\

put AR in move mode, and add your other rename task, should be fine

<Img Year> and others are the same datetimeoriginal, but scanned, formatted and saved in memory by AR when you import the files.


31/01-17 06:15
#5 : 31/01-17 06:30
G. Lambany
G. Lambany
Posts: 187
Reply to #3:
I agree that AR needs to add a few options to the field "apply to" in each method. Could include "path", "path + name" and "path + name + extension", or maybe checkboxes instead.. plus a way to output the output path with the script method, that would be pretty awesome, but anyway

cheers.. : )

31/01-17 06:30