ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: Elle Stone on January 26, 2011, 01:37:14 PM

Title: Can exiftool read metadata from files in one folder, write to files in another?
Post by: Elle Stone on January 26, 2011, 01:37:14 PM
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

Title: Re: Can exiftool read metadata from files in one folder, write to files in another?
Post by: Phil Harvey on January 26, 2011, 02:48:01 PM
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
Title: Re: Can exiftool read metadata from files in one folder, write to files in another?
Post by: Phil Harvey on January 26, 2011, 03:02:48 PM
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
Title: Re: Can exiftool read metadata from files in one folder, write to files in another?
Post by: Elle Stone on January 26, 2011, 06:47:22 PM
Thank you, thank you Phil - I will put that command line to good use.
Elle