Move or Copy files to new directory

Started by murphysm2342, January 18, 2017, 05:17:47 PM

Previous topic - Next topic

murphysm2342

I'm having a lot of trouble getting some code to work properly.  I need to take provided image files and move into a new directory based on three criteria:

  • predefined path: ~/Desktop/Output/_Complete/
  • Followed by a directory named as the data in the -creatoraddress tag
  • Followed by a directory named as first fifteen digits of the file name = %15f

For example, a file named BLYMP3001712172_01.jpg has a -creatoraddress of "17-01-09 Accessories PM1 B1 ericgeving W" and I want to move it into a new directory with the following path:
~/Desktop/Output/_Complete/17-01-09 Accessories PM1 B1 ericgeving W/BLYMP3001712172/

I've been trying many different variations and just get errors or directories named as the tag name.  Example of what I have tried:
exiftool -o ~/Desktop/Output/_Complete/-creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being copied into a directory called "-creatoraddress" and no sub-directory for filename

exiftool -directory=/Users/seanmurp/Desktop/Output/_Complete/-creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being moved into a directory called "-creatoraddress" but there is a sub-directory with filename(15 character) as expected.

exiftool -directory=/Users/seanmurp/Desktop/Output/_Complete/$creatoraddress/%15f -FileName=%15f%+.2nc.%e
This results in the file being moved into a directory called filename(15 character)

exiftool ~/Desktop/Output/_Complete/ "-directory<creatoraddress" -FileName=%15f%+.2nc.%e
This results in the file being moved into a directory named with the creatoraddress but at the user level not within ~/Desktop/Output/_Complete/

I'm sure this is probably some simple issue but help would be greatly appreciated.

StarGeek

See Common Mistakes #5 for some insights.

The equal sign assigns a constant value to a tag.  To copy the contents of a tag, you want to use the Greater/Less than sign.  Also, you don't want to have a leading dash in the source tag.  If you want to change Directory and Filename, you can include the directory path in the value you assign to Filename.

Try:
exiftool "-Filename</Users/seanmurp/Desktop/Output/_Complete/$creatoraddress/%15f%+.2nc.%e"
* 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).

murphysm2342

Tried that and this was the result:

f45c89a35e53:~ seanmurp$ exiftool "-Filename</Users/seanmurp/Desktop/Output/_Complete/$creatoraddress/%15f%+.2nc.%e" /Users/seanmurp/Desktop/Output/OLYMP3001712172_01.jpg
Warning: No writable tags set from /Users/seanmurp/Desktop/Output/OLYMP3001712172_01.jpg
Warning: Invalid tag name '/users/seanmurp/desktop/output/_complete//%15f%+.2nc.%e' - /Users/seanmurp/Desktop/Output/OLYMP3001712172_01.jpg
    0 image files updated
    1 image files unchanged


and just to make sure the creatoraddress is valid I ran this right after:
f45c89a35e53:~ seanmurp$ exiftool -creatoraddress /Users/seanmurp/Desktop/Output/OLYMP3001712172_01.jpg
Creator Address                 : EXIFTOOL_UPDATE_PHOTOGRAPHERNAME

StarGeek

Sorry, change the double quotes to single if your on linux/mac.
* 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).

murphysm2342