No tag value in the string, file is not processed

Started by Sunny, February 01, 2022, 11:24:01 AM

Previous topic - Next topic

Sunny

I have this question about file processing

exiftool -o . "-filename<${DateTimeOriginal;}/${Keywords;}/%%f%%-c.%%ue" -d %%Y.%%m.%%d %1

Everything works great but only if the files have the Keywords tag entered, if this value is missing the file is not processed. Is there any option to process the file even though the Keywords value is missing? In this case, for example, files without Keywords values should be placed in a folder with a date. Maybe there is a parameter that will do if no Keywords then e.g. Make

Something like this
exiftool -o . "-filename<${DateTimeOriginal;}/${if(Keywords,Make);}/%%f%%-c.%%ue" -d %%Y.%%m.%%d %1
:-\



StarGeek

From note #1 under the -TAG[+-^]=[VALUE] option.

    Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence

You can set a default path first which will be used if Keywords doesn't exist.

Here, if Keywords doesn't exist, it will use Model.  If neither exists, it makes a directory called NoKeywordsOrModel
exiftool -o .   "-filename<${DateTimeOriginal;}/NoKeywordsOrModel/%%f%%-c.%%ue" "-filename<${DateTimeOriginal;}/${Model;}/%%f%%-c.%%ue" "-filename<${DateTimeOriginal;}/${Keywords;}/%%f%%-c.%%ue" -d %%Y.%%m.%%d /path/to/files/
* 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).

Sunny

Quote from: StarGeek on February 01, 2022, 11:31:24 AM
From note #1 under the -TAG[+-^]=[VALUE] option.

    Many tag values may be assigned in a single command. If two assignments affect the same tag, the latter takes precedence

Thanks for the quick answer. I had a look at the link but I don't see anything there. How should it look in my concrete example.

/${Keywords;Make}/

Something like this doesn't work  :'(

StarGeek

If you want to use both items, you need to separate them.
/${Keywords;}${Make;}/
* 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).

Sunny

Quote from: StarGeek on February 01, 2022, 12:13:37 PM
If you want to use both items, you need to separate them.
/${Keywords;}${Make;}/
I have tested it but unfortunately it does not work. The Make tag is present but unfortunately is not placed in the absence of the Keywords tag

Quote---- IFD0 ----
Make                            : Xiaomi
Image Height                    : 3000

QuoteError: './maki.jpg' already exists - C:/Users/Andrzej/Desktop/foto/77/dir2/maki.jpg
    0 image files updated
    1 files weren't updated due to errors
-- press ENTER --

EDIT
The file that contains both the Keywords and Make tags uses the both to create the folder name and looks like this
ANDRZEJXiaomi


StarGeek

My first post showed you how to use make instead when keywords does not exist
* 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).

Sunny

Quote from: StarGeek on February 01, 2022, 12:56:41 PM
My first post showed you how to use make instead when keywords does not exist
Yes this way works very well. I thought something could be done in this second way. Thank you very much for your help  :)