ExifTool Forum

ExifTool => Newbies => Topic started by: Marie on December 06, 2019, 12:24:39 PM

Title: How to extract only selected files in a csv?
Post by: Marie on December 06, 2019, 12:24:39 PM
I try to use a conditional command as -if'$XMP:Label eq "Selected"' to extract only metadata for images that I have tagged as selected in Bridge in a csv, but it seems I do not have the right command. However, I am able to export the metadata -XMP:Label, but I would like to only have selected files in my .csv. Does anyone know how to do it?
If any help... this is the complet commande I use: exiftool -if'$XMP:Label eq "Sélectionner"' -csv -r -L -charset FileName=LATIN -G -XMP:Label -EXIF:CreateDate -XMP:Creator -File:FileName DIR >file.csv
Title: Re: How to extract only selected files in a csv?
Post by: Phil Harvey on December 06, 2019, 12:29:51 PM
You need a space after the -if argument.

- Phil
Title: Re: How to extract only selected files in a csv?
Post by: Marie on December 06, 2019, 01:44:21 PM
Thank you for your helpful answer. Finally, I also had to change my quotation marks: single quotation marks for double and double quotation marks for single (doesn't know why).
It works with: exiftool -if "$XMP:Label eq 'Selected'" -csv -r -L -charset FileName=LATIN -G -XMP:Label -EXIF:CreateDate -XMP:Creator DIR >file.csv
Title: Re: How to extract only selected files in a csv?
Post by: StarGeek on December 06, 2019, 01:48:19 PM
Arguments in Windows CMD have to be double quoted with single quotes on the inside of that.  Mac/Linux are the reverse.  That's just the way the OS is set up.
Title: Re: How to extract only selected files in a csv?
Post by: Marie on December 06, 2019, 02:38:39 PM
Thank you.