using regexp as list of input files to exiftool

Started by djholco, January 05, 2018, 10:27:59 PM

Previous topic - Next topic

djholco

I am doing a lot of old photos and slides where I have to put in metadata almost by hand. Several files will have the same -createdate for example. The naming system for files that I use will have those files in sequence, e.g. TEST01.jpg, TEST02.jpg, .... TEST09.jpg, TEST10.jpg. Typically I will want to add the metadata to a subset, such as TEST02.jpg, TEST03.jpg, TEST04.jpg, that cannot be designated by using the WINDOWS wildcards * and ?. The following used to work in a CMD window:

EXIFTOOL -createdate="2016:01:01" *0[2-4].jpg

Essentially the pattern from a regexp was used to pass in the list to EXIFTOOL. I used this approach a lot so I know it worked. But after a hiatus of several months from pictures, I started working again and this no longer works.

Curiously, under Powershell,  a similar command will work with dir, but not EXIFTOOL

DIR /b  *0[2-4].jpg

TEST02.jpg
TEST03. jpg
TEST04.jpg

Something has changed either in EXIFTOOL or CMD. Any ideas? There are other ways to do this task, but require some rewriting. I upgraded to exiftool ver 10.70 in early December but don't know if that is when this capability went away.

64 bit, Windows 10 Pro, Ver. 1709,  build 16299.192
exiftool 10.70

Phil Harvey

Unlike other platforms, in windows the wildcards are handled by the application, so this would be a change in ExifTool.  Currently ExifTool calls File::Glob to do this.  This hasn't changed for a long while, but certainly very old versions of ExifTool did this differently.  More recently I have updated the version of File::Glob in the exiftool package.  Do you know what version you were using?

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

djholco

thanks for quick reply. I have two older versions of exiftool that I kept and renamed as I updated exiftool. Version 8.1.8.0 and 9.8.0.0.  Version 9.8.0.0 was the version I was using when the regexp pattern worked, but I believe it also worked under the older 8.1.8.0.

I have tried using one of the older versions but the command no longer works. That may be because supporting software, libraries, etc, does not get reinstalled? By the way, I use the stand-alone windows executable and rename exiftool (-k) .exe --> exiftool.exe.

A separate thank you for the amazing feat of putting a usable interface between us users and the data monstrosity that is metadata.

Phil Harvey

All supporting libraries come with each exiftool version, so something else must have changed if the older version of exiftool behaves differently now.  The only thing I can think of is that before you were using a shell that expands the wildcards.  As far as I know, cmd.exe does not do this, and never did, but perhaps PowerShell or something else does.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

djholco

OK. Some problems are not worth the work to solve them.

I have always used the default CMD shell in Windows so that is not the cause.

I will either switch over to Powershell and use the DIR command which does the expansion, pipe it into a file, and use that as input to exiftool. Or use the IF command which also expands regular expressions.

Thanks for looking into this.

djholco

OOPS. I made a stupid mistake when I thought I had reinstalled exiftool 9.80.

When I did it properly, the regular expression expansion works just fine, as it always did. So it looks to me like FILE::GLOB may be the problem as that is the only relevant thing that has changed.

I downloaded the oldest version that is still on SourceForge, ver 10.55, and it does not expand the regex.

If there is a reliable source where the older versions are still available I could work my way back until I find the update where expansion ceased to work.


Phil Harvey

OK, thanks.  I can probably figure out what broke this for you.  I suspect it was when I added better Unicode file name support in Windows.  Unfortunately though, if it is a choice between Unicode support or this, then Unicode probably wins.  But I will look to see if I can make both work.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).