ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: jhaneyzz on March 15, 2013, 11:28:54 AM

Title: Process ONLY if newer than...
Post by: jhaneyzz on March 15, 2013, 11:28:54 AM
I am using the command line below to extract data from files ONLY if their FileModifyDate is newer than 2013-01-21 12:00:00.

The command ran fine, except it did not limit the output by date.

Is there a way to construct the command in order to do this?

LCCmacMini:bin jhaney$ exiftool -T -d "%Y/%m/%d %H:%M:%S" -charset UTF8 -r -f -scanForXMP -fast2 -ext .jpg -ext .png -ext .gif -ext .tif -ext .tiff -ext .psd -ext .pdf -ext .indd -ext .ai -ext .eps -ext .mov -ext .3gp -ext .wmv -ext .flv -FileName -Directory -FileSize# -FileModifyDate -FileCreateDate -FileType -ImageWidth -ImageHeight -Format -ColorMode -Software -ModifyDate -CreatorTool -CreateDate -xmpCreateDate -xmp:DateCreated -xmp:DateTime -xmp:ModifyDate -xmp:MetadataDate -xmp:pdf:CreationDate -xmp:pdf:ModDate -xmp:DocumentID -xmp:InstanceID -xmp:DerivedFromInstanceID -xmp:DerivedFromDocumentID -xmp:OriginalDocumentID -xmp:ManifestReferenceDocumentID -xmpManifestReferenceInstanceID -xmp:CopyrightFlag -xmp:Creator -xmp:Description -xmp:Keywords -xmp:Marked -xmp:CopyrightOwner -xmp:CopyrightOwnerName -xmp:Usage -xmp:xmpRights -xmp:CopyrightStatus -Description -if '$FileModifyDate > 2013-01-21 12:00:00' "/Volumes/Archive/" >> "/Users/jhaney/dateLimitTest.txt"
Title: Re: Process ONLY if newer than...
Post by: Phil Harvey on March 15, 2013, 12:14:27 PM
Yes.  Use 'gt' (string compare) instead of '>' (integer compare).

- Phil
Title: Re: Process ONLY if newer than...
Post by: jhaneyzz on March 15, 2013, 01:49:11 PM
I figured it was something like that, but I thought it would be best to post the code in case I was using incorrect syntax or overlooking something else.

Title: Re: Process ONLY if newer than...
Post by: Phil Harvey on March 15, 2013, 01:56:01 PM
Also, looking again at your command, you are also missing quotes around the date/time string.  Try this:

    -if '$FileModifyDate gt "2013-01-21 12:00:00"'

- Phil
Title: Re: Process ONLY if newer than...
Post by: jhaneyzz on March 15, 2013, 04:46:00 PM
I figured that out before I ran it again. I assumed that a string would need quotes.

Glad I was right.

"Even a blind squirrel finds a nut once in a while!"