News:

2023-08-10 - ExifTool version 12.65 released

Main Menu

Extended naming of files

Started by thefaion, January 22, 2022, 02:15:35 PM

Previous topic - Next topic

thefaion

I have lost some photos on my drive, so I have begun the long process of using Photorec to dig for deleted data on my drive.

It picks up everything that was ever deleted.

So far I have 70,000 images, about 1/3 of the way through.

I have started renaming all of the files;

exiftool "-FileName<CreateDate" -d "%Y_%m_%d-%H:%M:%S.%%e" .

But with so many files, I am getting quite a lot of duplicates (that are different photos).  Is there a way I can add another variable into the renaming process such as LightValue or HyperfocalDistance?

exiftool "-FileName<CreateDate" -d "%Y_%m_%d-%H:%M:%S.%%e_%LightValue" .     ??

So that I can get a truly unique filename I can sort?

StarGeek

The simplest thing would be to add a copy number.  For example, this will add (dash)(number) if there's a file with the same name
exiftool "-FileName<CreateDate" -d "%Y_%m_%d-%H:%M:%S%%-c.%%e" .

If you wish to add an actual tag name, you will need to move the %e token out of the -d (-dateFormat) format string.  For example
exiftool "-FileName<${CreateDate}_${LightValue;}.%e" -d "%Y_%m_%d-%H:%M:%S" .
* 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).

thefaion

Thanks for the reply.  I apologize, I'm a newbie at this  :P

I tried your suggestion, and it says
bash: -FileName<${CreateDate}_${LightValue;}.%e: bad substitution

I'm on Linux  8) if that helps

StarGeek

Quote from: thefaion on January 22, 2022, 03:04:40 PMI'm on Linux  8) if that helps

Use single quotes instead of double quotes.  Bash interprets the dollar sign as the start of a shell variable and it isn't passed properly to exiftool.
* 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).