Mass transfer of information

Started by GOST_, September 03, 2024, 07:58:56 AM

Previous topic - Next topic

GOST_

Good morning,
please help and advice. I need to transfer the -Subject and -ImageDescription information from a number of images from the directory c:\picture\a\ to other images in the directory c:\picture\b\. I'm trying it with the command: exiftool -TagsFromFile c:\picture\a\*.jpg -Subject -ImageDescription c:\picture\b\
I'm making a mistake somewhere and I can't write the command correctly.
Thank you

StarGeek

From the docs on the -TagsFromFile option
QuoteFor advanced batch use, the source file name may also be specified using a FMT string in which %d, %f and %e represent the directory, file name and extension of FILE. (eg. the current FILE would be represented by %d%f.%e, with the same effect as @). See the -w option for FMT string examples.

Try this, assuming the file extensions in \b\ are the same as in \a\
exiftool -TagsFromFile c:\picture\a\%f.%e -Subject -ImageDescription c:\picture\b\

If you're copying to a different file type, for example, \b\ holds PNG files with the same base name, you would change %e to the source file extension
exiftool -TagsFromFile c:\picture\a\%f.jpg -Subject -ImageDescription c:\picture\b\
* 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).

GOST_

Thanks for the advice. Is there a way to set the command to accept the file name 004-0001.jpg if I use %f?
Thank you

StarGeek

The above command assumes that the files in \a\ have the same name as the files in \b\. If there is a file named 004-0001.jpg in both directories, then %f.%e will copy the Subject and ImageDescription tags from \a\004-0001.jpg to \b\004-0001.jpg

If the filenames are similar, but missing or adding some characters, then that can usually be compensated for with the advanced features of the percent variables. See the -w (-TextOut) option for the details.

If the filenames are completely different, for example you want to copy from \a\abc.jpg to \b\def.jpg, then there's no way for exiftool to know how to match them.

If you are using a Windows batch file, make sure and read FAQ #27, My ExifTool command doesn't work from a Windows .BAT file
* 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).

GOST_

Thanks for the advice. I read the instructions and found that I have to type %%f