Assigning value out of parallel file as filename

Advanced Renamer forum
#1 : 08/07-20 21:45
Schowalter
Schowalter
Posts: 4
Hello,

I would like to rename a lot of video-clips (avi) using the origin recording date as filename.

The problem is, that the original recording date is not available in the meta-data of the avi-file, but there exists a second file to each avi-file that contains the recording date.

How can I rename all clips the the original recording date using the Advance Renamer-Tool?

Example:

I have the following files in one folder:

clip01.avi
clip01.avi.modd
clip02.avi
clip02.avi.modd
clip03.avi
clip03.avi.modd
...

The modd-files contain the recording date as follows:
<?xml version="1.0" encoding="utf-8"?>
<plist version="1.0"><dict><key>MetaDataList</key><array><dict><key>DateTimeOriginal</key><real>41423,259016203701000</real></dict></array><key>XMLFileType</key><string>ModdXML</string></dict></plist>

The recording-timestamp in this file is:

41423,259016203701000

Which is the decimal value for

29.05.2013 06:12:59

Therefore I would like to rename the clip01.avi to
2013-05-29_06-12-59

...and all other clips to the according name....

Is this possible anyhow ?

Thank you very much for your help!


08/07-20 21:45
#2 : 09/07-20 12:51
David Lee
David Lee
Posts: 1125
It's possible to do what you ask using scripting but you should be able to do this much more simply using the tag: <ExifTool:DateTimeOriginal>.

Hopefully both the .avi and .modd files will contain this timestamp, in which case it you can simply use two methods to rename both file types at the same time:

1) Replace method...
Text to be replaced: ".*?(?=(\.|$))"
Replace with: <ExifTool:DateTimeOriginal>
Use regular expressions
Apply to Name

2) List replace method...
Replace "_" with "-"
and space with "_"

Let me know if this works - otherwise I'll suggest a more devious "plan B".


09/07-20 12:51
#3 : 09/07-20 14:08
David Lee
David Lee
Posts: 1125
Reply to #2:

I've just found an avi file on my PC and it doesn't contain the timestamp, so it looks like "plan B" will be necessary!

The trick will be to rename the modd file as I suggested and use Pair renaming to rename the avi file to correspond.

To be recognized as a pair both files must have the same name and differ only in the extension. Unfortunately Advanced Renamer will always rename the modd file to match the avi, which is the wrong way round, even if you rename the extension of the avi file.

The solution is temporarily to rename both files to: clip.avi.txt and clip.avi.mod before running the replace method. The ExifTool plugin will still recognize the mod file but ARen will not and so will behave as we require.

ARen recognizes file pairs based on the original filenames and extensions, so you will have to carry out the renaming using three passes...

Pass one - List replace method...
Replace "avi" with "avi.txt"
and "modd" with "mod"
Apply to: Extension

Run the batch and reload all files when prompted.

Make sure that the Pair renaming box is checked

Pass two - Replace method...
Text to be replaced: ".*?(?=(\.|$))"
Replace with: <ExifTool:DateTimeOriginal>
Use regular expressions
Apply to Name

Run the batch and reload all files when prompted.

Uncheck the Pair renaming box.

Pass three - List replace method...
Replace "_" with "-"
Replace space with "_"
Replace "txt" with blank
Replace "mod" with "modd"
Apply to: Name and extension

Hopefully this will work for you - otherwise we will have to use scripting.


09/07-20 14:08 - edited 09/07-20 14:12
#4 : 09/07-20 14:08
Schowalter
Schowalter
Posts: 4
Reply to #2:

It works for the modd-file, but not for the avi-file. I assume this is, because the avi-file does not contain a timestamp tag.....

So I would need a second method to copy the new filename of the modd-file to the corresponding avi-file.....

Is this your plan B?


09/07-20 14:08
#5 : 09/07-20 14:10
David Lee
David Lee
Posts: 1125
Reply to #4:

See "plan B" above. Our posts crossed at exactly the same time!


09/07-20 14:10
#6 : 09/07-20 14:38
Schowalter
Schowalter
Posts: 4
Reply to #5:

Hello David,
it works !!! :-)

Thank you for this great help!

I'll gladly by a private license to honor your support for this tool....

One more questions:
If I add the files of a folder (not only specific files), only avi-files will be added and not the .avi.modd files. Is this a bug?


09/07-20 14:38
#7 : 09/07-20 15:09
David Lee
David Lee
Posts: 1125
Glad it worked!

I'm not sure I understand your last question.

I should point out that I am only a user of this program - the developer is Kim Jensen. Aby bug reports should be sent to him: [email protected]


09/07-20 15:09
#8 : 09/07-20 15:41
Schowalter
Schowalter
Posts: 4
Reply to #7:

To add several files to the AR, I press the button "Hinzufügen" (Add) and then "Verzeichniss" (Folder).
The selected Folder contains different filetypes; for example with avi and modd extension. But only the avi-files will be added...

Why are other files not included?

As you are not the one who would get the donation for the license... Thank you to inform me about the name and mail of the author.... In this case my appreciation is for you, because of your great help!!!


09/07-20 15:41
#9 : 13/07-20 09:08
CarolineWebb
CarolineWebb
Posts: 1
Thanks.


13/07-20 09:08 - edited 13/07-20 09:11