Skip if filename matches pattern?

Started by theprof, October 20, 2024, 06:05:40 PM

Previous topic - Next topic

theprof

I have the following command:
exiftool \
-P \
-overwrite_original_in_place \
-FileOrder CreateDate -FileOrder -FileSize -FileOrder FileModifyDate \
-api QuickTimeUTC \
-if '$MimeType=~/^(video|image)\//i' \
'-AllDates<FileModifyDate#' \
'-AllDates<${DateTimeOriginal#;$_ = undef if $_ lt "1971"}' \
'-AllDates<${CreateDate#;$_ = undef if $_ lt "1971"}' \
-d "%Y-%m-%d %H-%M-%S %%.2nc.%%le" \
'-FileName<FileModifyDate' \
'-FileName<${DateTimeOriginal;$_ = undef if $_ lt "1971"}' \
'-FileName<${CreateDate;$_ = undef if $_ lt "1971"}' \
"$DIR"


What I want to do is if the "FileName" already matches the pattern, then it should skip over that file.

theprof

This is what I have so far:
exiftool \
-P \
-overwrite_original_in_place \
-api LargeFileSupport \
-FileOrder CreateDate -FileOrder -FileSize -FileOrder FileModifyDate \
-api QuickTimeUTC \
-if '$MimeType=~/^(video|image)\//i' \
-d "%Y-%m-%d %H-%M-%S %%.2nc.%%le" \
'-AllDates<FileModifyDate#' \
'-AllDates<${DateTimeOriginal#;$_ = undef if $_ lt "1971"}' \
'-AllDates<${CreateDate#;$_ = undef if $_ lt "1971"}' \
'-FileName<FileModifyDate' \
'-FileName<${DateTimeOriginal;$_ = undef if $_ lt "1971"}' \
'-FileName<${CreateDate;$_ = undef if $_ lt "1971"}' \
-r "$DIR"


What I want to do is run the command above for only files where part of the file name that is a date does not match the create date or if the file name does not contain a date.

The file name pattern for most of the files are: 4 digit year-2 digit month-2 digit day 24-hour clock 2 digit-2 digit minutes-2 digit second file increment number

Examples:
2019-01-01 15-01-01 01.mp4
2019-02-01 01-05-01 01.mp4
IMG001.jpg




StarGeek

Try adding
-if "$Filename ne $CreateDate"

If your post falls through the cracks like this did, just bump it, add a new reply to bring it back to the top, instead of reposting.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype