Printing part of a string value from a tag

Started by jeff_k, January 12, 2023, 12:48:16 AM

Previous topic - Next topic

jeff_k

I am trying to print the left 10 characters of a tag value but cannot figure out the right syntax for what I think is the right approach.
I think using -p might get me there, but...
exiftool -q -p '${tag;tr/ /_/}' .
from the FAQ works fine. But if I'd want to only display the left 10 characters of -tag, how would I do so?
I tried:
exiftool -q -p '${tag;substr($_,0,10)}' . but that does not work — it simply outputs the full tag.
With '${tag;substr($tag,0,10)}', error messages result.

Is there a different way to do this?
Thanks!

jeff_k