Using TagsFromFile to change dates on several files based on one file

Started by oivindmi, June 03, 2020, 04:32:33 PM

Previous topic - Next topic

oivindmi

Hi,

I want to copy createdate metadata from one file to several files (all JPG).

The source file is in folder "I:/Newly imported photos/" while the destination files (multiple) are in "I:/Newly imported photos/destination/"

I have tried:

exiftool -all:all -TagsFromFile "I:\Newly imported photoes\%f.jpg" "-CreateDate<CreateDate" "I:/Newly imported photos/destination/"

but I must be doing something wrong.


StarGeek

If it's a single, known, file that you want to copy from, replace the %f with that filename.  For example, if the file you are copying from is called "GreatImage.jpg", you would use -TagsFromFile "I:\Newly imported photoes\GreatImage.jpg"

The %f token uses the name of the file currently being processed.  So if your files are 001.jpg, 002.jpg, 003.jpg, it will take the 001, 002, or 003 and replace the %f with that value.  Since you don't have files with those names in "Newly imported photoes", you get an error.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

oivindmi

Thank you StarGeek! Much Appreciated! How would this look if I wanted to do the same operation with multiple files with the same name in two different folders?

I get confused when I have to put the DIR in quotation marks and then add %f or something afterward. I can't seem to get it quite right.



StarGeek

Your original command should work if there's a file with the same name in both directories, except for the -all:all part. Not sure what you're doing there.  If you're trying to copy all tags, then it needs to come after the -TagsFromFile option.  And you don't need to use "-CreateDate<CreateDate", just -CreateDate would work, though if you're copying all tags, you don't need to add it separately.

So if you have these files
I:/Newly imported photos/0001.jpg
I:/Newly imported photos/destination/0001.jpg

Then
exiftool -TagsFromFile "I:/Newly imported photoes/%f.jpg" -CreateDate "I:/Newly imported photos/destination/"
should copy the CreateDate over.

If you're using a bat file, see my .sig. 
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

oivindmi

Love it! Thanks for clearing that up for me! Really appreciate it! :)