Is it possible to integrate these two commands into one? I tried it with IF- and Or-statements, but I can't get it to work.
exiftool -if 'not $FileName =~/VIDEO/i' '-FileName<${CreateDate}.%e' -d %Y%m%d%H%M%S%%-c
exiftool -if '$FileName =~/VIDEO/i' '-FileName<${CreateDate}-$FileName' -d %Y%m%d%H%M%S%%-c
Thanks in advance,
Fulco
Hi Fulco,
The -if option either processes a file or not. It doesn't allow different processing for different files.
But you should be able to do what you want like this:
exiftool '-FileName<${CreateDate}${FileName;$_=/VIDEO/i ? "-$_" : ".%e"}' -d %Y%m%d%H%M%S%%-c
- Phil
Many thanks! I couldn't figure it out by myself.
- Fulco
This command will only work when the filename contains "VIDEO". Is it possible to add conditionally the CreateDate in front of the filename when it contains "VIDEO", "IMG" or "MVI"? I can't find any logic to make it work.
exiftool '-FileName<${CreateDate}${FileName;$_=/VIDEO/i ? "-$_" : ".%e"}' -api QuickTimeUTC -d %Y%m%d%H%M%S%%-c
- Fulco
Hi Fulco,
Replace VIDEO in the regular expression with (VIDEO|IMG|MVI)
- Phil
It works! Thanks again.
- Fulco