ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: philbond87 on February 03, 2023, 03:34:56 PM

Title: Use contents of a tag + my own text in a single command?
Post by: philbond87 on February 03, 2023, 03:34:56 PM
I'm trying to figure out how (or even if it's possible) to take the contents of a tag – ImageSize, for example – and prefix that with some other string characters.

Essentially I'm trying to use the a file's tag value as a variable, adding additional text to it, then putting the results into some other tag... all in one line.

Is that possible?

Thanks
Title: Re: Use contents of a tag + my own text in a single command?
Post by: philbond87 on February 03, 2023, 03:52:06 PM
I believe I have stumbled upon (a) solution:

Although what I'm doing is somewhat specific to Swift, the end result seemed to be to use -if $SomeTag -SomeOtherTag<${SomeTag} (... then add my additional text)
Title: Re: Use contents of a tag + my own text in a single command?
Post by: Phil Harvey on February 04, 2023, 07:35:49 AM
You don't need the -if.  If SomeTag doesn't exist then SomeOtherTag won't get written (unless you use the -f or -m option).

- Phil
Title: Re: Use contents of a tag + my own text in a single command?
Post by: philbond87 on February 04, 2023, 08:09:41 AM
Ah... good to know.
Thank you!