Thread

Posted on Wed Apr 23 13:04:08 2008 by heiko
write filename without extension to XMP:Description
Hello, I like to write the filename without the file extension to XMP:Description ExifTool -XMP:Description<FileName *.* writes the complete name into the description field (with extension) ExifTool -XMP:Description<%f *.* writes the string '%f' into the description field. What I'm doing wrong?? Regards Heiko
Direct Responses: 7726 | Write a response
Posted on Wed Apr 23 13:54:19 2008 by exiftool in response to 7725
Re: write filename without extension to XMP:Description
Hi Heiko,

You can only use %f, %d and %e where a filename would be expected, so they can't be used to set the description. Instead, you must use a command like this:

exiftool "-xmp:Description<filename" *.*

but this command will also write the file extension. If you don't want the extension, you must create a user-defined tag to strip it off. Luckily, this is one of the example tags defined in the sample config file. So after installing the config file, you have a new "basename" tag which can be used to do what you want:

exiftool "-xmp:Description<basename" *.*

Also, I would recommend using "." (the current directory) instead of "*.*" (all files in the current directory), because then exiftool won't try to process files with unknown extensions (and subdirectories containing a "." in the name).

- Phil
Direct Responses: 7728 | Write a response
Posted on Wed Apr 23 14:43:53 2008 by heiko in response to 7726
Re: write filename without extension to XMP:Description
Hello Phil, thank you for your quick answer. I've searched in the whole documentation, but have not thought at the .exiftool_config file. Now it works without any problems. The *.* was an example; in a real case I won't call ExifTool with *.* Thanks a lot Heiko
Write a response