ExifTool Forum

ExifTool => Newbies => Topic started by: SlavePunisher on September 08, 2017, 08:54:35 AM

Title: List file if one date differs from the other two
Post by: SlavePunisher on September 08, 2017, 08:54:35 AM
Hi everybody,

I've been working around a command to write a list of pictures, only when one or two date(s) of filemodifydate, datetimeoriginal and CreateDate differs from the others and/or is empty. No way to make it work. I've tried hundreds of different variations... no way, my level in Exiftool doesn't allow me to understand :'(

exiftool -if '$datetimeoriginal=~s/ .*// and $createdate=~s/ .*// and $filemodifydate=~s/ .*//' /Users/name/FolderA/FolderB -r -datetimeoriginal -filemodifydate -CreateDate -filename -T > ~/Desktop/out.txt

Thanks a lot for your help
Title: Re: List file if one date differs from the other two
Post by: StarGeek on September 08, 2017, 02:53:52 PM
Rather than use regex to strip away the time, use the -d (https://exiftool.org/exiftool_pod.html#d-FMT--dateFormat) to make it easier to compare.  Then use hashtags to disable the date conversion when you output the tags.

exiftool -d %Y%m%d -if "$createdate ne $datetimeoriginal or $createdate ne $filemodifydate or $datetimeoriginal ne $filemodifydate" -r -datetimeoriginal# -filemodifydate# -createdate# -filename -T
Title: Re: List file if one date differs from the other two
Post by: SlavePunisher on September 08, 2017, 04:29:15 PM
Amazing !!! Works like a charm !!

Many many thanks  :D