ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: nitinkan on July 18, 2019, 12:14:57 PM

Title: Failed Condition
Post by: nitinkan on July 18, 2019, 12:14:57 PM
How do I go about getting a list of files that "failed condition" (-if)?
Title: Re: Failed Condition
Post by: Phil Harvey on July 18, 2019, 12:22:31 PM
You could do this, but it would be a separate command:

exiftool -aaa -if "not CONDITION" DIR

Either that, or add -v to the original command and look for lines with "(failed condition)".

- Phil
Title: Re: Failed Condition
Post by: nitinkan on July 19, 2019, 10:37:32 AM
I would like to get a list of (failed condition) files formatted in a way that can then be programmatically re-processed from the same (windows) batch file.

Trying to do the following:
- If DateTimeOriginal exists, rename files with DateTimeOriginal.
- For failed condition files, set AllDates and Filename to FileModifyDate.

Is there a way to store the failed condition list in some sort of global/persistent variable using .ExifTool_config?  Or can this be done in some other manner via perl or windows batch scripts?  Looking for ideas to do this without manual intervention ...
Title: Re: Failed Condition
Post by: Phil Harvey on July 19, 2019, 10:46:16 AM
This can be done in one command using a little trick from this post (https://exiftool.org/forum/index.php/topic,10310.msg54186.html#msg54186):

exiftool "-filename<filemodifydate" "-filename<datetimeoriginal" "-alldates<${filemodifydate#;$_ = undef if $self->GetValue('DateTimeOriginal')}" -d YOUR_FILENAME_DATE_FORMATTING DIR

- Phil