Hi,
I am trying to convert the result of the exif tag "Long Exposure Noise Reduction" to a keyword of "Long Exposure Noise Reduction On" or "Long Exposure Noise Reduction Off" saved into the sidecar file.
exiftool displays it as:
Long Exposure Noise Reduction : Off
Any assistance would be very much appreciated!
I think that something like this may be what you want:
exiftool "-subject+<${LongExposureNoiseReduction;$_=qq(Long Exposure Noise Reduction $_)}" FILE
Here I have used the qq() quoting to get around the problem of quotes within quotes.
- Phil
Edit: Here is a cool alternative that avoids the need for nested quotes:
exiftool "-subject+<${LongExposureNoiseReduction;s/^/Long Exposure Noise Reduction /}" FILE
Thanks so much, Phil. This worked. One last thing, is there a way to add to the existing keywords rather than overwrite the sidecar?
Oh, right. You wanted this for a sidecar (I'm assuming XMP-format) file:
exiftool -srcfile %d%f.xmp "-subject+<${LongExposureNoiseReduction;s/^/Long Exposure Noise Reduction /}" FILE
Where FILE is your image file name. Or directory name, but then you should add -ext options for the image file types you want to process.
Existing XMP in the sidecar will be preserved. It will be created it it didn't exist beforehand.
- Phil