Moving files into new directory according two exif tags

Started by Tania, September 15, 2014, 12:29:13 PM

Previous topic - Next topic

Tania

Hi!
I know it's pretty easy to move files into new directory using one exif tag. For example if I want to create a directory from "Headline" tag I use:
exiftool -d %Y-%m-%d "-directory<Headline" filename.jpg ;

But I now want to use two exif tags (ProgramVersion+Headline). How do I make it happen?

Thanks in advance

StarGeek

Try this

exiftool -d %Y-%m-%d "-directory<$ProgramVersion_$Headline" filename.jpg

Change the underscore into whatever character(s) you want to separate the tags with.
"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

Tania

Quote from: StarGeek on September 15, 2014, 02:20:40 PM
Try this

exiftool -d %Y-%m-%d "-directory<$ProgramVersion_$Headline" filename.jpg

Change the underscore into whatever character(s) you want to separate the tags with.
yeah I've been trying the same thing, but I can't get it work:

exiftool -d %Y-%m-%d "-directory<$Filename_$Headline" *.jpg
Warning: No writable tags set from f_001.jpg
Warning: No writable tags set from f_002.jpg
Warning: No writable tags set from f_003.jpg
Warning: No writable tags set from f_004.jpg
Warning: No writable tags set from f_005.jpg
    0 image files updated
    5 image files unchanged

Phil Harvey

Note that both ProgramVersion and Headline must exist or nothing will be copied.

There is also a problem with your command.  Since "_" is a valid character in a tag name, you must put braces around ProgramVersion to separate it from the "_":

exiftool -d %Y-%m-%d "-directory<${ProgramVersion}_$Headline" filename.jpg

Also note that this quoting is for Windows.  Mac and Linux users need to use single quotes instead.

- 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 ($).


Phil Harvey

Great.

One more thing I didn't notice until now.  The -d %Y-%m-%d is completely superfluous in your command since you are not copying any date/time tags.  So you can drop this and make your command simpler.

- 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 ($).

StarGeek

Quote from: Phil Harvey on September 15, 2014, 07:40:57 PM
There is also a problem with your command.  Since "_" is a valid character in a tag name, you must put braces around ProgramVersion to separate it from the "_":

Oops, my mistake.  That's what I get for not testing it out first.
"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