Copy Exif tags for several files in a directory

Started by Birdman, October 27, 2023, 04:02:23 PM

Previous topic - Next topic

Birdman

Hi everyone,

I am looking for a solution to process the following command to several files in a directory:
exiftool -TagsFromFile File.jpg File-NoExif.jpg
The files are something like this:
File1.jpg File1-NoExif.jpg
File2.jpg File2-NoExif.jpg
File3.jpg
File4.jpg File4-NoExif.jpg

If there is a file containing "-NoExif" in the filename, the command should be executed and copy all exif tags from the "normal" jpg to the "-NoExif" jpg.

Is it possible to manage this with Exiftool alone?
Best regards,

Martin (Birdman)

StarGeek

Try
exiftool -if "$Filename=~/NoExif/" -TagsFromFile %d%-.7f.%e -EXIF:All /path/to/files/

First, it checks to see if "NoExif" is in the filename.  Then, it will look for a file to copy from in the same directory and snip seven characters from the end of the base filename.

Change the double quotes to single quote if using Mac/Linux.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Birdman

#2
Thanks. Do I have to change something when working with Windows?
exiftool -if "$Filename=~/genErase/" -TagsFromFile %d%-.9f.%e -EXIF:All D:\Bilder\Neu\Exiftool\Test\The following message is shown when executed:

D:\Bilder\NEU\exiftool\Test>exiftool -if "$Filename=~/genErase/" -TagsFromFile -.9f.All D:\Bilder\Neu\Exiftool\Test\
File '-.9f.All' does not exist for -tagsFromFile option

Solved: Needs %% instead of % Works now perfectly, thanks again!
Best regards,

Martin (Birdman)

StarGeek

"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype