IPTC: I want to duplicate (and modify) one field to another [solved]

Started by brokeiptc, March 14, 2017, 04:10:11 PM

Previous topic - Next topic

brokeiptc

Hi everyone,

I made a giant mess, and by accident changed the IPTC field "Title" of over a thousand files to some random gibberish in Adobe Bridge. :/

Luckily, the data I need is already in the files - the description field looks like this "word1 word2 word3 word4 word5" and the title should look like "word1 word2 word3 word4" - so, identical, just without the last word. Sometimes the last word is word4 and sometimes it's word5 (that's why I didn't say "the first four words", as it depends, and it's most precise if I define it as a lack of the last word, whichever that is).

Is there any way I can automate this change by using exiftool, as I really really don't feel like manually changing over a 1000 files

Thanks,
Nina

StarGeek

The Title field in Adobe Bridge writes to the IPTC:ObjectName and the XMP:Title tags, so I assume you would want to write to both.  In that case, a simple copy would be
exiftool "-ObjectName<Description" "-Title<Description" FileOrDir

As for the editing of the description before copying, you would have to provide more detailed information, as sometimes word4, sometimes word5 is too vague to be able to give you a complete command.
"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

brokeiptc

Quote from: StarGeek on March 14, 2017, 05:26:59 PM
The Title field in Adobe Bridge writes to the IPTC:ObjectName and the XMP:Title tags, so I assume you would want to write to both.  In that case, a simple copy would be
exiftool "-ObjectName<Description" "-Title<Description" FileOrDir

As for the editing of the description before copying, you would have to provide more detailed information, as sometimes word4, sometimes word5 is too vague to be able to give you a complete command.
Thanks.

As for the editing -

let's say that one description is "banana on blue background", and another description is "red apple on green background". The corresponding titles should be "banana on blue" and "red apple on green". Does this example make it clearer?

StarGeek

Ah, so it's just remove the last word, which is what you said in your first post.  My mistake for not reading carefully (I do this way to often).

Try this.  It will remove that last word and the space before it before copying the tag.  In this case, a word is defined as a group of characters containing upper and lowercase letters, numbers, and underscore (A-Z, a-z, 0-9 _).  If the last word might have an apostrophe for example, there would have to be a change to the command.
exiftool "-ObjectName<${Description;s/ +\w+$//}" "-Title<${Description;s/ +\w+$//}" FileOrDir
"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

brokeiptc

Quote from: StarGeek on March 14, 2017, 05:45:46 PM
Ah, so it's just remove the last word, which is what you said in your first post.  My mistake for not reading carefully (I do this way to often).

Try this.  It will remove that last word and the space before it before copying the tag.  In this case, a word is defined as a group of characters containing upper and lowercase letters, numbers, and underscore (A-Z, a-z, 0-9 _).  If the last word might have an apostrophe for example, there would have to be a change to the command.
exiftool "-ObjectName<${Description;s/ +\w+$//}" "-Title<${Description;s/ +\w+$//}" FileOrDir

Thank you so much, works perfectly!