Author Topic: Want to fill IPTC:Caption with photo filename - without the extension  (Read 4066 times)


  • Newbie
  • *
  • Posts: 2
    • Photos on
I am using the following command to fill the IPTC:Caption field with the filename of my photos.

     exiftool "-IPTC:Caption-Abstract<filename"

This is working, except that the ".jpg" is also included in the field.

Is there a way to exclude the .jpg when I do this?

Note:  the filenames are complex, such as:  "N757VA  Boeing 757-223  KIAD  20090115.jpg"

Edit:  I did search for this subject in older posts.  I found one similar question, but the specifics were not the same.

PH Edit: fixed typo in command
« Last Edit: November 18, 2011, 12:32:31 PM by Phil Harvey »

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16667
    • ExifTool Home Page
There are a few threads on this subject.  here is one.

The answer is to create a user-defined tag.  The sample config file included with the full distribution has a "Basename" tag which does exactly this.

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