Can exiftool read metadata from files in one folder, write to files in another?

Started by Elle Stone, January 26, 2011, 01:37:14 PM

Previous topic - Next topic

Elle Stone

Hi All,

The following command recursively reads "-TagsList" from jpegs in "newfolder" and writes the contents to the cr2 file in the same folder, with the same name (leastways, I hope I didn't make any mistakes here):

exiftool -tagsfromfile %d%f.jpg -TagsList -r -overwrite_original -ext cr2 /media/b3/newfolder

Is there a way to ask ExifTool to recursively read jpegs in one folder, and write to cr2 files by the same name, but located in another folder?

Tia,
Elle


Phil Harvey

Hi Elle,

Sure.  But the trick here is that you need to use relative paths because you don't want the "/media/b3/newfolder" in the -tagsFromFile argument.  So you execute the command from within this folder, like this:

cd /media/b3/newfolder
exiftool -tagsfromfile /some/other/folder/%d%f.jpg -TAGS -r -overwrite_original -ext cr2 .


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Phil Harvey

I should mention that this would be a lot simpler if you didn't have sub-folders (ie. if you weren't using the -r option).  In this case you wouldn't need to change directories:

exiftool -tagsfromfile /some/other/folder/%f.jpg -TAGS -overwrite_original -ext cr2 /media/b3/newfolder

But I think the point of the question was the problem with sub-folder names when using -r, so I just mention this for other people who might not need to recurse into sub-folders.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Elle Stone

Thank you, thank you Phil - I will put that command line to good use.
Elle