Increment the creation date using the sequence number in the file name

Started by Gorrunyo, March 11, 2024, 01:05:14 AM

Previous topic - Next topic

Gorrunyo

I'm using a tool that sorts images by creation date.
I have a bunch of negatives I scanned, all with the same creation date and with file names like this:

place_001.jpg
place_002.jpg
...

the goal would be to increment the creation date using the sequence number in the file name so the application will sort them in the right sequence.

My question is why this command line is not working?

exiftool -datetimeoriginal+="0000:00:00 00:00:${Basename;m/^[^_]+_([\d]+)$/;$_=$1}" .\place_001.jpg
    0 image files updated
    1 image files unchanged



I'm sure there is a better method to do what I need

Thanks

Phil Harvey

I assume you are on Windows CMD because of the quoting.

This is common mistake 5c.  Use "+<" instead of "+=".

- 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 ($).

Gorrunyo

Thanks for the reply,

Yes, I'm using Windows, but I can run it on Linux too.
Somehow, this doesn't seem to go through either

exiftool -datetimeoriginal .\place_001.dng
Date/Time Original              : 1993:07:03 02:49:10

exiftool "-datetimeoriginal+<0:0:${Filename;m/^[^_]+_([0-9]+).+/;$_=$1}" .\place_001.dng
Warning: No writable tags set from ./place_001.dng
Warning: Invalid tag name '0:0:'. Use '=' not '<' to assign a tag value - ./place_001.dng
    0 image files updated
    1 image files unchanged

Gorrunyo

It seems to work on Linux

exiftool '-datetimeoriginal+<0:0:${Filename;m/^[^_]+_([0-9]+).+/;$_=$1}' ./place_001.dng
    1 image files updated

Thanks

StarGeek

Quote from: Gorrunyo on March 13, 2024, 10:15:41 PMYes, I'm using Windows, but I can run it on Linux too.
Somehow, this doesn't seem to go through either

Warning: Invalid tag name '0:0:'. Use '=' not '<' to assign a tag value - ./place_001.dng

I'm guessing that you're using PowerShell to get this error.  Use CMD, not PS.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).