Add DateTimeOriginal to FileName if it is not in the FileName #447
|
Hello, I'm using this command line in the Windows (DOS)-environment to add the date and time to filenames is they are not already in it: Now, if I test this command line it it works fine, but if I execute this command line it still adds the DateTimeOriginal to all the files. Example test command line: So I think it has something to do with the -d FMT (-dateFormat) I'm reusing to add the original filename to the execution part of the command as explained on the Exiftool page. The problem is: I need to configure the date format to check if it is in (a part of) the filename by replacing the ":" with "-" and then I need to add the original filename to the format to rename it. Notes:
|
Replies: 2 comments 2 replies
|
I can't really give a proper answer right now because I don't have access to my desktop at the moment. But you cannot have more than one What I think is happening is that only the last I won't be able to give a proper answer until tomorrow evening. I'll come back and edit this response when I have access to my computer. |
|
Sorry for taking so long. After getting back from my convention, I was hit by a case of Con Crud. To make your command work, you want to use the
Example. There are two files that already match the time stamp pattern and one that doesn't, but has the same time stamp as one of the other files. So there are two files that fail the |
Sorry for taking so long. After getting back from my convention, I was hit by a case of Con Crud.
To make your command work, you want to use the
DateFmthelper function when checking to see if the filename already matches. The-doption is used for the actual renaming part of the command.exiftool -d "%Y-%m-%d %H-%M-%S%%-c %%f.%%e" -if "$Filename!~${DateTimeOriginal;DateFmt('%Y-%m-%d %H-%M-%S')}" "-TestName<DateTimeOriginal" /path/to/files/Example. There are two files that already match the time stamp pattern and one that doesn't, but has the same time stamp as one of the other files. So there are two files that fail the
-ifoption because they already have the correct time stamp in the …