Filtering files that exiftool processes

Started by mrverdantgreen, June 18, 2020, 02:50:23 PM

Previous topic - Next topic

mrverdantgreen

I am using the following command (thanks StarGeek & Phil) to copy the names of NEF files and their associated .xmp sidecar files to a temp file that I can then use in a subsequent step to move these files to another directory. This works great.

exiftool -srcfile %d%f.xmp -if 'lc $AttributionName ne "off" and $Rating>=1' -p '$OriginalDirectory/$OriginalFileName' "$source" >"temp.txt"

I have two questions about this command and the related command I run right before this:


  • However in some circumstances, I only want to include the NEF files and skip the associated .xmp sidecar files. I could sed or awk the temp file to remove the .xmp files, but is there some way to do this in the exiftool command itself?
  • Beyond my control, the directories where I run this command (and a previous exiftool command that copies a field from the NEF to the $AttributionName field in the .xmp sidecar) often have other files, like random TIFFs and other stuff lying around. These exiftool commands throw errors about not being able to find the xmp file for these TIFFs. Is there some filter I can apply to exiftool commands to limit what they scan to *just* NEF files?  For completeness, here is the other exiftool command that throws these errors:
    exiftool "-AttributionName<ActiveD-Lighting" -srcfile %d%f.xmp -ext nef -overwrite_original_in_place .

I've searched the doc, but couldn't find anything that looked like it applied. Any help is greatly appreciated!

StarGeek

You probably want the -ext (extension) option.

Add -ext nef to only process NEFs.  This will not stop exiftool from checking the file indicated with the -srcfile option.

Add --ext xmp (two dashes) to exclude processing xmp files.

You can mix and match, add as many -ext options as you need.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype