ExifTool Forum

ExifTool => Newbies => Topic started by: aab203 on June 15, 2018, 09:56:17 AM

Title: Using -T and wanting fixed width view
Post by: aab203 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

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
Title: Re: Using -T and wanting fixed width view
Post by: StarGeek on June 15, 2018, 10:50:50 AM
Quote from: aab203 on June 15, 2018, 09:56:17 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 (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat) 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.
Title: Re: Using -T and wanting fixed width view
Post by: aab203 on June 16, 2018, 08:35:39 PM
Thank you - I'll take a look at your suggestions :)