Printing a tag's information in alphabetical order?

Started by rodertroy, March 06, 2021, 02:02:29 PM

Previous topic - Next topic

rodertroy

After updating to Exiftool 12.21 I ran the above command again:

exiftool -v -q -ext webp -if '$Artist' -p '$Artist' . | sort | uniq -c | sed 's/ *\([0-9]*\)\t*\(.*\)/\2 (\1)/'

And I got Artist tags listed the way I want. The only problem now is that the output gives me way too much information:

Quote+ [BinaryData directory, 10 bytes] (6)
   + [BinaryData directory, 135994 bytes] (1)
   + [BinaryData directory, 20010 bytes] (1)
   + [BinaryData directory, 39234 bytes] (1)
   + [BinaryData directory, 43340 bytes] (1)
   + [BinaryData directory, 58738 bytes] (1)
   + [BinaryData directory, 91222 bytes] (1)
   + [TIFF directory] (6)
   Directory = . (6)
   EXIF (SubDirectory) --> (6)
   ExifToolVersion = 12.21 (6)
   FileAccessDate = 1615426521 (2)
   FileAccessDate = 1615426524 (1)
   FileAccessDate = 1615426549 (3)
   FileInodeChangeDate = 1615426520 (3)
   FileInodeChangeDate = 1615426548 (3)
   FileModifyDate = 1615426520 (3)
   FileModifyDate = 1615426542 (3)
   FileName = output.20210310.163122462-0.webp (1)
   FileName = output.20210310.163122462-1.webp (1)
   FileName = output.20210310.163122462-2.webp (1)
   FileName = output.20210310.203448207-0.webp (1)
   FileName = output.20210310.203448207-1.webp (1)
   FileName = output.20210310.203448207-2.webp (1)
   FilePermissions = 33279 (6)
   FileSize = 136136 (1)
   FileSize = 20152 (1)
   FileSize = 39376 (1)
   FileSize = 43482 (1)
   FileSize = 58880 (1)
   FileSize = 91364 (1)
   FileType = WEBP (6)
   FileTypeExtension = WEBP (6)
   MIMEType = image/webp (6)
   VP8Bitstream (SubDirectory) --> (6)
   VP8X (SubDirectory) --> (6)
   | + [IFD0 directory with 5 entries] (6)
   | ExifByteOrder = II (6)
   | HorizontalScale = 0 (6)
   | ImageHeight = 1024 (2)
   | ImageHeight = 1200 (1)
   | ImageHeight = 1600 (1)
   | ImageHeight = 174592 (1)
   | ImageHeight = 261888 (2)
   | ImageHeight = 306944 (1)
   | ImageHeight = 3072 (1)
   | ImageHeight = 409344 (1)
   | ImageHeight = 683 (1)
   | ImageHeight = 786176 (1)
   | ImageWidth = 1024 (1)
   | ImageWidth = 1056965807 (1)
   | ImageWidth = 1200 (1)
   | ImageWidth = 1600 (1)
   | ImageWidth = 2304 (1)
   | ImageWidth = 2852127743 (1)
   | ImageWidth = 2936014399 (1)
   | ImageWidth = 4278190762 (2)
   | ImageWidth = 4278192383 (1)
   | ImageWidth = 683 (2)
   | VP8Version = 0 (6)
   | VerticalScale = 0 (6)
   | | 0)  XResolution = 72 (72/1) (6)
   | | 1)  YResolution = 72 (72/1) (6)
   | | 2)  ResolutionUnit = 2 (6)
   | | 3)  Artist = birch (3)
   | | 3)  Artist = pine (3)
   | | 4)  YCbCrPositioning = 1 (6)
RIFF 'EXIF' chunk (96 bytes of data): (6)
RIFF 'VP8 ' chunk (135994 bytes of data): (1)
RIFF 'VP8 ' chunk (20010 bytes of data): (1)
RIFF 'VP8 ' chunk (39234 bytes of data): (1)
RIFF 'VP8 ' chunk (43340 bytes of data): (1)
RIFF 'VP8 ' chunk (58738 bytes of data): (1)
RIFF 'VP8 ' chunk (91222 bytes of data): (1)
RIFF 'VP8X' chunk (10 bytes of data): (6)
birch (3)
pine (3)

I only want the output to show me the bottom two lines "birch (3)" and "pine (3)".




Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

rodertroy