ExifTool Forum

ExifTool => Newbies => Topic started by: AlanX on April 25, 2019, 11:21:54 AM

Title: An embarrassingly basic question on overwriting metadata, or not!
Post by: AlanX on April 25, 2019, 11:21:54 AM
As an infrequent user, and being forgetful in my old age, I'd appreciate help on one simple question.
I want to write the contents of one metadata field to another (in the same image file). I can't find the option switches for "always overwrite what's there", "don't write if there's data already there", and "append my data to what's there". Can someone point me in the right direction? I'm lost in the mountain of support documentation and don't know where to look! Thanks.
Title: Re: An embarrassingly basic question on overwriting metadata, or not!
Post by: StarGeek on April 25, 2019, 11:39:45 AM
Check the -wm (writemode) option (https://exiftool.org/exiftool_pod.html#wm-MODE--writeMode).
Title: Re: An embarrassingly basic question on overwriting metadata, or not!
Post by: AlanX on April 25, 2019, 12:53:37 PM
Well, I think I've tried every combination of w, c, and g, without getting consistent results:

C:\ExifTool\exiftool -wm c "-Caption-Abstract< by $Creator" *.jpg
C:\ExifTool\exiftool -wm c "-XMP:Rights<&copy; $Creator" -E *.jpg -k

My first aim to write to these fields and overwrite anything that or may not be there already.
Title: Re: An embarrassingly basic question on overwriting metadata, or not!
Post by: Phil Harvey on April 25, 2019, 12:58:20 PM
Quote from: AlanX on April 25, 2019, 12:53:37 PM
My first aim to write to these fields and overwrite anything that or may not be there already.

You mean create them if they don't exist, or overwrite previous values if they already existed?  If so, that is the default behaviour, and the -wm option isn't necessary.

The -wm c option that you used will only write them if they didn't exist previously, but only if other IPTC or XMP metadata already existed in the file (it won't create a new IPTC or XMP group without "g").

- Phil