Substitute and concatenate

Started by SimoneUe, July 08, 2018, 05:33:18 AM

Previous topic - Next topic

SimoneUe

Hi,
I am still learning my ropes  :)

So far I can substitute text (I only want first names of the creators in the description field):
exiftool -overwrite_original '-Description<${Creator;s/ .*//g}'

I also know how to concatenate text:
exiftool -title<Mfg=$make'

Now I would like to combine the two, but somehow I struggle with the syntax. I tried different options, e.g.
exiftool -overwrite_original '-Description<${Caption-Abstract "Foto: " Creator;s/ .*//g}'

But as soon as I use the curly bracket, I cannot concatenate, without them, I cannot substitute.

Any help much appreciated

StarGeek

You only need to use braces when a tag name includes advanced formatting (${Creator;s/ .*//g}) or when it bumps up against other text (xXx${Creator}xXx).  You don't put anything else inside the braces that's not advanced formatting.

In your example, Caption-Abstract doesn't bump up against other text and no advanced formatting is being done to it, so it doesn't need braces, though it isn't hurt by doing so.  So separate each item in your concatenation:
exiftool -overwrite_original '-Description<$Caption-Abstract "Foto: " ${Creator;s/ .*//g}'

"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

SimoneUe