ExifTool Forum

ExifTool => The "exiftool" Application => Topic started by: aperturemode on October 16, 2024, 06:21:26 PM

Title: Writing Metadata to text, with exceptions for specified tags
Post by: aperturemode on October 16, 2024, 06:21:26 PM
I'm writing the metadata for a group of .tif files in particular folders, to text files, using the command:
exiftool -w txt -G0:1 -a -s *.tif
Is it possible to add exceptions so that certain tags or tag groups aren't include in the outputted text file? I tried using the double dash argument, for example, --xmp:all, but that didn't work for me.

Title: Re: Writing Metadata to text, with exceptions for specified tags
Post by: StarGeek on October 16, 2024, 08:33:56 PM
The double hyphen is the correct way to do it. See the --TAG option (https://exiftool.org/exiftool_pod.html#TAG1).

An example. For the comamnd line output, I suppress the composite tags (see the -e (--composite) option (https://exiftool.org/exiftool_pod.html#e---composite)) and the system tags. Then I run your command, but also include the -e and --system:all. Typing the output to the command line shows that XMP is also suppressed.
C:\>exiftool -G1 -a -s -e --system:all y:\!temp\Test4.jpg
[ExifTool]      ExifToolVersion                 : 12.98
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Big-endian (Motorola, MM)
[File]          ImageWidth                      : 1749
[File]          ImageHeight                     : 1205
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[IFD0]          XResolution                     : 72
[IFD0]          YResolution                     : 72
[IFD0]          ResolutionUnit                  : inches
[IFD0]          YCbCrPositioning                : Centered
[ExifIFD]       ExifVersion                     : 0232
[ExifIFD]       DateTimeOriginal                : 2000:01:01 00:00:00
[ExifIFD]       ComponentsConfiguration         : Y, Cb, Cr, -
[ExifIFD]       FlashpixVersion                 : 0100
[ExifIFD]       ColorSpace                      : Uncalibrated
[XMP-x]         XMPToolkit                      : Image::ExifTool 12.98
[XMP-dc]        Description                     : A description
[XMP-dc]        Subject                         : A keyword
[XMP-exif]      DateTimeOriginal                : 2024:10:16 12:00:00

C:\>exiftool -w txt -G0:1 -a -s -e --system:all --xmp:all y:\!temp\Test4.jpg
    1 output files created

C:\>type y:\!temp\Test4.txt
[ExifTool]      ExifToolVersion                 : 12.98
[File]          FileType                        : JPEG
[File]          FileTypeExtension               : jpg
[File]          MIMEType                        : image/jpeg
[File]          ExifByteOrder                   : Big-endian (Motorola, MM)
[File]          ImageWidth                      : 1749
[File]          ImageHeight                     : 1205
[File]          EncodingProcess                 : Baseline DCT, Huffman coding
[File]          BitsPerSample                   : 8
[File]          ColorComponents                 : 3
[File]          YCbCrSubSampling                : YCbCr4:2:0 (2 2)
[EXIF:IFD0]     XResolution                     : 72
[EXIF:IFD0]     YResolution                     : 72
[EXIF:IFD0]     ResolutionUnit                  : inches
[EXIF:IFD0]     YCbCrPositioning                : Centered
[EXIF:ExifIFD]  ExifVersion                     : 0232
[EXIF:ExifIFD]  DateTimeOriginal                : 2000:01:01 00:00:00
[EXIF:ExifIFD]  ComponentsConfiguration         : Y, Cb, Cr, -
[EXIF:ExifIFD]  FlashpixVersion                 : 0100
[EXIF:ExifIFD]  ColorSpace                      : Uncalibrated

If you are still getting a different result, copy/paste your exact command and the result, so we can see where something might be wrong.
Title: Re: Writing Metadata to text, with exceptions for specified tags
Post by: aperturemode on October 17, 2024, 09:37:33 PM
So of course now it works after I posted it. Not sure what I did wrong before, but thank you for confirming the right approach.