So my files are named img_YYYYddmm_HHMMSS.jpg and I'm trying to conditionally decide to only process those files that match that format. I try:
exiftool -if "${filename=~/\D+\d{8}_\d{6}\D+/}" (dostuff) ./tmp
But all files fail the condition. I can try making it a substitution with s/// and get it to work but is that really necessary? Any tips?
Your expression has a syntax problem. The regular expression should be outside the braces:
-if "${filename}=~/\D+\d{8}_\d{6}\D+/"
- Phil
doh, thanks!
Hey quick question, do elseif statements not work with config files? I always get an error if I try to use any. Don't know if I'm just doing something wrong since I'm new to perl syntax. For instance:
if (expression){
dosomething;
} elseif (expression){
dosometehingelse;
}
Always returns a syntax error. I don't recall the documentation noting it, if I'm mistaken my apologies :)
There's other ways but this is just convenient lol
Quote from: stackfl0w on April 02, 2020, 12:24:43 PM
Hey quick question, do elseif statements not work with config files?
elsif (https://perldoc.perl.org/functions/elseif.html), not
elseif.
Ah, saved again from my carelessness! I need to start paying attention to my P's and Q's. Thanks again!
... and E's ...
Indeed lol