Author Topic: T (-table) Output tag values in table form  (Read 2367 times)

lonny

  • Newbie
  • *
  • Posts: 1
T (-table) Output tag values in table form
« on: May 28, 2010, 08:01:38 PM »
Mac OS X 10.6.3, Intel, exiftool 8.20

I am using "exiftool -T -a /path/to/image/directory/ > ~/Desktop/text.txt" to create a tab-delimited table-form text file which contains meta information from each image within a directory of images. This works perfectly. However, the columns do not have labels showing what tag name each value represents. Is there a way to print the tag name at the top of each column?
instead of this:
8.1   IMG_0070.JPG   /Volumes/tempbox/mvardaro/FFWV Feb2010   1488 kB   2009:08:08 20:58:24-07:00   rwxrwxrwx   JPEG

you should get this:
ExifTool Version Number   File Name   Directory   File Size   File Modification Date/Time   File Permissions   File Type
8.1   IMG_0070.JPG   /Volumes/tempbox/mvardaro/FFWV Feb2010   1488 kB   2009:08:08 20:58:24-07:00   rwxrwxrwx   JPEG   

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 14896
    • ExifTool Home Page
Re: T (-table) Output tag values in table form
« Reply #1 on: May 29, 2010, 06:41:22 AM »
There is no way to do this when extracting all tags from a file because the extracted tags will be different for each file.  To have the same tag in each column you need to decide on a specific set of tags to extract then do something like this:  (Note: The following echo command works in a bash shell, but the technique to get tabs in other shells may be different.)

Code: [Select]
echo -e "ExifTool Version Number\tFile Name\tDirectory\tFile Size\tFile Modification Date/Time\tFile Permissions\tFile Type" > out.txt
exiftool -exiftoolversion -filename -directory -filesize -filemodifydate -filepermissions -filetype -T /path/to/image/directory >> out.txt

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