ExifTool Forum

ExifTool => Newbies => Topic started by: warrencalvert on November 02, 2022, 06:08:48 AM

Title: Deleting two specific keywords
Post by: warrencalvert on November 02, 2022, 06:08:48 AM
Hi
In the following section of xmp I need to delete both the DateRangeStart and DateRangeEnd

 <rdf:Description rdf:about=''
  xmlns:MY='http://ns.mylollc.com/MyloEdit/'>
  <MY:DateRangeScope/>
  <MY:DateRangeStart>2022-10-30T10:02:57.000</MY:DateRangeStart>
  <MY:DateRangeEnd>2022-10-30T10:02:57.000</MY:DateRangeEnd>
  <MY:MetadataDate>2022-11-02T09:40:30.552Z</MY:MetadataDate>
  <MY:Undated>false</MY:Undated>
  <MY:flag>false</MY:flag>
  <MY:processVersion>1</MY:processVersion>
 </rdf:Description>

I tried the command below for one file as a test but its not quite right, it doesnt work.

exiftool -all-="{DateRangeStart,DateRangeEnd}" dsc_9326.xmp

Please advise what I've done wrong.
Also, how would I modify this to process all xmp files in all folders recursively?
Would it just be a case of adding -r and *.xmp to the above?

Thanks,
Warren.
Title: Re: Deleting two specific keywords
Post by: warrencalvert on November 02, 2022, 06:34:29 AM
Hi

Further to the above, I've also realised I need to remove these two keywords from all JPG, NEF and XMP files. 
Can I just use * to process everything?

Thanks,
Warren.
Title: Re: Deleting two specific keywords
Post by: Phil Harvey on November 02, 2022, 08:21:31 AM
Hi Warren,

You will need to create user-defined tags to delete these nonstandard XMP tags.  See the example config file (https://exiftool.org/config.html) for examples on creating user-defined XMP tags.

Once you have done this, the command to do this recursively for all .xmp, .jpg and .nef files in a directory and its sub-directories is:

exiftool -daterangestart= -daterangeend= -ext xmp -ext jpg -ext nef -r DIR
Title: Re: Deleting two specific keywords
Post by: StarGeek on November 02, 2022, 11:15:55 AM
I believe this post (https://exiftool.org/forum/index.php?topic=13157.msg71122#msg71122) contains the config file needed to edit these tags.
Title: Re: Deleting two specific keywords
Post by: warrencalvert on November 02, 2022, 12:50:57 PM
Thanks, I've download the config file but no idea what changes to make to it.
Sorry - please could you help with how to define the new XMP tag?
Its really not clear from the config file which lines I need to add it to.
Title: Re: Deleting two specific keywords
Post by: warrencalvert on November 02, 2022, 01:36:40 PM
sorry, I misread your post.  Didnt realise you'd linked to the actual config file I need.
That works perfectly, thanks for your help.
Title: Re: Deleting two specific keywords
Post by: StarGeek on November 02, 2022, 02:19:42 PM
To clarify for anyone else coming upon this thread.

The config file is the first "CODE" section in that post.  Hit select and copy/paste the text into a file using something like notepad.  Save it to the same directory as exiftool with a name like Mylo.Config

The -Config option (https://exiftool.org/exiftool_pod.html#config-CFGFILE) must be the first option to use the config file, so the command would look like
exiftool -config mylo.config -daterangestart= -daterangeend= -ext xmp -ext jpg -ext nef -r DIR