Complex Custom Hierarchy...

Started by captured, October 29, 2016, 04:37:33 PM

Previous topic - Next topic

captured

Hello.

This is complex, can someone please help with the correct syntax ?

Objective;
Make a custom hierarchy...

Desired Output Hierarchy;
Parent-Directory
    DateTimeOriginal
        Make
            Model

Conditions;
allow for illegal characters
allow for multiple tags redirected to Directory hierarchy
copy only
do not change any modify/create/access dates

e.g.
Parent-Directory = Todays-Shoot
DateTimeOriginal = 2016-10-28
Make = Canon
Model = 5D Mark III

Desired Result;
2016-10-28/Canon/5DMark III/File01.CRW
2016-10-28/Fuji/XT-2/File02.RAF
2016-10-28/Sony/A6500/File03.ARW

I'm using Linux;
exiftool -P -o dummy/ '-Directory<$DateTimeOriginal/${Make;}/${Model;}' -d "Result/%Y-%m-%d" .

Am I going about this the correct way or is there a more correct syntax ?

Thank you.




StarGeek

Quote from: captured on October 29, 2016, 04:37:33 PM
I'm using Linux;
exiftool -P -o dummy/ '-Directory<$DateTimeOriginal/${Make;}/${Model;}' -d "Result/%Y-%m-%d" .

Am I going about this the correct way or is there a more correct syntax ?

It looks good.  Offhand, I don't see any place for things to get messed up.  Is it working for you?

"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

captured

Thank you.

It's working, but a.) the 'dummy/' is confusing me if I need it or not ?.

Also, b.) I don't understand why this doesn't work...
exiftool -P -o dummy/ '-Directory<$DateTimeOriginal/${Make;}_${Model;}' -d "Result/%Y-%m-%d" .
but this does...
exiftool -P -o dummy/ '-Directory<$DateTimeOriginal/${Make;}-${Model;}' -d "Result/%Y-%m-%d" .

Thanks again.

Phil Harvey

a) Adding the -o option causes the file to be copied instead of moved, but the directory name is overridden by writing the Directory tag, so "dummy/" is sufficient here.  Perhaps -o copy/ would be more intuitive.

b) Either should work.  Is the only difference that the "_" is replaced by a "-"?  There must be something else happening.  What messages did you get?

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

captured

Hello.

1. The dummy/ is 'not' receiving images, they end up in 'Result/'
I read the instructions as the dummy/ should receive the images in this example.

exiftool -P -o dummy/ '-Directory<$DateTimeOriginal/${Make;}/${Model;}' -d "Result/%Y-%m-%d" .

2. May I ask how to remove spaces if '${Model;}' has spaces in the result ?

Thank you again.


Phil Harvey

Sure, you would do this:

${model;tr( /\\?*:|"<>\0)()d}

This expression just adds a space to the default advanced formatting expression.  See the -p option documentation for details.

- 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: captured on October 30, 2016, 02:27:47 PM
1. The dummy/ is 'not' receiving images, they end up in 'Result/'
I read the instructions as the dummy/ should receive the images in this example.

From the docs on -o:
"When writing only FileName and/or Directory "pseudo" tags, -o causes the file to be copied instead of moved, but directories specified for either of these tags take precedence over that specified by the -o option."

You are specifying a Directory tag, so that takes precedent.
"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

Phil Harvey

Thanks StarGeek, I missed answering the first question.

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

captured

Gentlemen, thank you.

Removing spaces [Solved].

I looked through the docs for "pseudo" tags and didn't find pseudo defined.
http://www.exiftool.org/exiftool_pod.html#m

If the (-o dummy/) is not receiving, and Result/ is...
if I remove dummy/, shouldn't exiftool use Result/ and 'not' require (-o dummy/) ?

e.g.
exiftool -P -o '-Directory<$DateTimeOriginal/${Make;}/${Model;}' -d "Result/%Y-%m-%d" .

Best regards.


Phil Harvey

Quote from: captured on October 31, 2016, 11:45:14 PM
I looked through the docs for "pseudo" tags and didn't find pseudo defined.
http://www.exiftool.org/exiftool_pod.html#m

See here.

QuoteIf the (-o dummy/) is not receiving, and Result/ is...
if I remove dummy/, shouldn't exiftool use Result/ and 'not' require (-o dummy/) ?

No.  Both StarGeek and I have already told you why.

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

captured

Thank you both for your assistance in navigating the maze of exiftool.
It's much appreciated.

It is not always immediately clear after the 1st explanation.

Exiftool and it's support has no competition and remains the King.

Cheers.

[SOLVED]