I'm trying to insert the filename into the metadata for JPG's with an empty RawFilename field, using the %f wildcard. I'm using the below code, to no avail:
exiftool '-RawFilename=%f' -overwrite_original "C:\Test\Image1.jpg"
I tried it with and without the single quote around the underlined part.
Any suggestions? Thanks.
The percent tokens (%f, %e, %c, etc) can't be copied to a tag. They're for use with various file operations and format strings, such as -TagsFromFile (https://exiftool.org/exiftool_pod.html#tagsFromFile-SRCFILE-or-FMT) or -w (textout) (https://exiftool.org/exiftool_pod.html#w-EXT-or-FMT--textOut) options or setting the Filename/Directory pseudo tags.
This should do what you want:
exiftool "-rawfilename<${filename;/(.*)\./ and $_=$1}" FILE
- Phil