File renaming with more than one tag?

Started by Beholder3, July 28, 2012, 05:24:42 AM

Previous topic - Next topic

Beholder3

Hi,

I want to rename a bunch of files based on their metadata under windows.
I read http://www.exiftool.org/filename.html and think it should look similar to
exiftool "-filename<FocalLength" IMAGE.JPG

But I want to create more complex filenames such as "30 mm taken with aperture F8.JPG" meaning name with a number of metadata tags used and some free form text. I do not know how to "connect" the tag strings into one filename.

Alan Clifford

I just tried this on my mac.  I think you need to use double quotes on windows though

exiftool '-filename<focal length $focallength taken with aperture $aperture.%e' willthiswork.jpg

I've never tried stuff like this before but it seems to have worked.

Beholder3

Ah, thanks. That really seems to work with double quotes on windows.  :)

So the rules are:
a) put double quotes around the whole thing
b) type what ever text you wish after the
"-filename<"
c) insert any tags with a leading "$"

Phil Harvey

It looks like you've got this figured out.  Just one more thing that may be useful:

d) enclose tag name in curly brackets if necessary to separate the name from subsequent text.  (ie. if the character following the tag name is A-Z, a-z, 0-9, -, _, : or #)

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

Beholder3

Thanks.  :)
Can you say where I should have looked for this piece of syntax in the online documentation?
I just could think of "renaming".

Sometimes it's like reading a Chinese dictionary - you know it is in there somewhere but you have no clue what to look for.

Phil Harvey

All of the copying features are documented under the -tagsfromfile option in the application documentation.  This section refers you to the documentation for the -p option which contains a full description of this syntax (since it uses the same syntax).

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