ExifTool Forum

ExifTool => Newbies => Topic started by: Sunny on February 01, 2022, 11:24:01 AM

Title: No tag value in the string, file is not processed
Post by: Sunny on February 01, 2022, 11:24:01 AM
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
:-\


Title: Re: No tag value in the string, file is not processed
Post by: StarGeek on February 01, 2022, 11:31:24 AM
From note #1 under the -TAG[+-^]=[VALUE] option (https://exiftool.org/exiftool_pod.html#TAG---VALUE).

    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/
Title: Re: No tag value in the string, file is not processed
Post by: Sunny on February 01, 2022, 11:56:05 AM
Quote from: StarGeek on February 01, 2022, 11:31:24 AM
From note #1 under the -TAG[+-^]=[VALUE] option (https://exiftool.org/exiftool_pod.html#TAG---VALUE).

    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  :'(
Title: Re: No tag value in the string, file is not processed
Post by: StarGeek on February 01, 2022, 12:13:37 PM
If you want to use both items, you need to separate them.
/${Keywords;}${Make;}/
Title: Re: No tag value in the string, file is not processed
Post by: Sunny on February 01, 2022, 12:37:41 PM
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

Title: Re: No tag value in the string, file is not processed
Post by: StarGeek on February 01, 2022, 12:56:41 PM
My first post showed you how to use make instead when keywords does not exist
Title: Re: No tag value in the string, file is not processed
Post by: Sunny on February 01, 2022, 01:12:44 PM
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  :)