ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: jeff_k on January 12, 2023, 12:48:16 AM

Title: Printing part of a string value from a tag
Post by: jeff_k on January 12, 2023, 12:48:16 AM
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!
Title: Re: Printing part of a string value from a tag
Post by: jeff_k on January 12, 2023, 12:53:11 AM
Well...never mind. Figured it out from this post (https://exiftool.org/forum/index.php?topic=4799.0).