Author Topic: Using -T and wanting fixed width view  (Read 390 times)

aab203

  • Newbie
  • *
  • Posts: 8
Using -T and wanting fixed width view
« on: June 15, 2018, 09:56:17 AM »
Hi,

Might be a silly question and probably not Exiftool specific, but I was wondering if there is a way to use the -T command when outputing a number of items into the Terminal (macOS), but to have each printed column's minimum width to align to whatever is the widest string in that column... if that makes sense.

For example if I do exiftool -T -filename -fileModifyDate -createDate -dateTimeOriginal -creationDate .

I see
Code: [Select]
2017.08.19 - IMG_7116.MOV 2017:08:19 13:50:05+01:00 2017:08:19 19:51:09 - 2017:08:19 13:50:05+01:00
IMG_7118.JPG 2017:08:19 14:24:13+01:00 2017:08:19 14:24:13 2017:08:19 14:24:13 -
IMG_7119.JPG 2017:08:19 14:26:34+01:00 2017:08:19 14:26:34 2017:08:19 14:26:34 -
IMG_7127.JPG 2017:08:19 14:42:27+01:00 2017:08:19 14:42:27 2017:08:19 14:42:27 -
2017.08.19 - IMG_7124.MOV 2017:08:19 14:30:07+01:00 2017:08:19 20:05:30 - 2017:08:19 14:30:07+01:00
2017.08.19 - IMG_7125.MOV 2017:08:19 14:30:39+01:00 2017:08:19 13:30:39 - 2017:08:19 14:30:39+01:00

Ideally, to make it easier to read (especially when having different image types which have different default metadata tags filled out) i'd like all the column width to line up.

Thanks in advance  :D

StarGeek

  • Global Moderator
  • ExifTool Freak
  • *****
  • Posts: 2569
Re: Using -T and wanting fixed width view
« Reply #1 on: June 15, 2018, 10:50:50 AM »
Might be a silly question and probably not Exiftool specific, but I was wondering if there is a way to use the -T command when outputing a number of items into the Terminal (macOS), but to have each printed column's minimum width to align to whatever is the widest string in that column... if that makes sense.

I'd say that you're either going to have to create your own output string with the -p option or pipe the output through another command line program such as awk.  Looking around on the net, there also appears to be a unix command called Columns which would do what you want, but I'm not sure if there's a Mac port.
Troubleshooting hints:
* When posting, include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).
* Double all percent signs (%) in a Windows batch file.
* If your GPS coords are negative, make sure and set the GpsLatitudeRef and GpsLongitudeRef tags correctly.

aab203

  • Newbie
  • *
  • Posts: 8
Re: Using -T and wanting fixed width view
« Reply #2 on: June 16, 2018, 08:35:39 PM »
Thank you - I'll take a look at your suggestions :)