Author Topic: Know the file extension and writing it to Metadata  (Read 1859 times)

Offline Dino

  • Newcomer
  • *
  • Posts: 4
    • View Profile
Know the file extension and writing it to Metadata
« on: April 19, 2024, 08:08:35 PM »
I know that if Photo Mechanic is processing a file with the name of "DSC_0001.JPG" there are variable you can write to metadata such as variables like {filenamebase} which would be DSC_0001 and {filename} which would be DSC_0001.JPG but I want to write the extension of the file being processed for this example .JPG which would be great if there was a variable like {filenameext} file name extension.

Is there a method to know the extension of the file being processed.

Thanks,
Dino

Offline Bob M

  • Full Member
  • ***
  • Posts: 153
    • View Profile
    • The McElroys of Point Alexander
Re: Know the file extension and writing it to Metadata
« Reply #1 on: April 20, 2024, 08:13:30 AM »
You could use substring extraction on {filename} to get the last three characters.

Offline Max Lemesh

  • Full Member
  • ***
  • Posts: 169
    • View Profile
Re: Know the file extension and writing it to Metadata
« Reply #2 on: April 20, 2024, 11:35:17 AM »
Yeah, something like that would be great.


You could use substring extraction on {filename} to get the last three characters.

except you can't use this variable in folder string in ingest

Offline Kirk Baker

  • Senior Software Engineer
  • Camera Bits Staff
  • Superhero Member
  • *****
  • Posts: 25020
    • View Profile
    • Camera Bits, Inc.
Re: Know the file extension and writing it to Metadata
« Reply #3 on: April 21, 2024, 09:08:12 AM »
You could use substring extraction on {filename} to get the last three characters.

Specifically, use: {filename:-3}

-Kirk