Does one know how I'd go about to make exiftool transpose output?
I.e. 2 separate columns instead of 20+?
I'm aware Excel and LibreCalc have this feature built in.
If you run ExifTool with no arguments you get a 2-column output. Maybe add -S to show tag names and remove extra spaces. The only problem here may be that colon-space is the delimiter between the tag names an the values.
- Phil
Maybe I'm not understanding correctly. Can you show an example? When you say transpose, it sounds to me that you want the tag names to be rows and the filenames to be headers
| File1.jpg | File2.jpg |
| Sourcefile | /path/to/File1.jpg | /path/to/File2.jpg |
| Description | Description 1 | Description 2 |
| DateTimeOriginal | 2021:01:01 12:00:00 | 2023:04:01 12:00:00 |
| Title | Title 1 | Title 2 |
Document links
-csv option (https://exiftool.org/exiftool_pod.html#csv-CSVFILE)
FAQ #12 (https://exiftool.org/faq.html#Q12)
That is what I understood by transpose as well. But he said 2-column, which would be only a single file. Transposing the output for multiple files would be difficult.
- Phil
I'm outputting to a CSV file.
exiftool 'video1.mp4' -csv > out.csv
Instead of
+----------+-------------+--------+---------+------------+-----------+
| Filename | Title | Length | Bitrate | Resolution | Comment |
+----------+-------------+--------+---------+------------+-----------+
| video1 | Anniversary | 03:05 | 6000 | 720 | Last year |
+----------+-------------+--------+---------+------------+-----------+
Make it look like the following:
+------------+-------------+
| Filename | video1 |
| Title | Anniversary |
| Length | 03:05 |
| Bitrate | 6000 |
| Resolution | 720 |
| Comment | Last year |
+------------+-------------+
I'm only analyzing one video. But the ability to compare 2 side by side is nice.
Sorry for the lack of clarity. This was initially a response to another old post.
My command should work for that.
- Phil
It puts it only in one column, for me:
exiftool video.mp4 > out.csv
+----------------------+
| Filename: video1 |
| Title: Anniversary |
| Length: 03:05 |
| Bitrate: 6000 |
| Resolution: 720 |
| Comment: Last year |
+----------------------+
In Libre calc, you can change the delimiter
(https://i.imgur.com/MAhNtfU.png)
It's not perfect, as some data, such as date/time stamps, also have colons which get separated.
Ah, finally got it using a variation on the Filter given FAQ #12 (https://exiftool.org/faq.html#Q12). BTW Phil, the filter as written for Windows doesn't work. The qq needs 4 quotes, e.g. qq{""""$_""""}
Example, Description has doubled quotes because I set it to a value of ""My Description" (quotes included)
C:\>exiftool -e -S -api filter="$_ = qq{""""$_""""} if s/""/""""/g or /:/ or /(^\s+|\s+$)/ or /[,\n\r]/ " y:\!temp\Test4.jpg
ExifToolVersion: 12.60
FileName: Test4.jpg
Directory: "y:/!temp"
FileSize: 449 kB
FileModifyDate: "2023:04:16 12:00:00-07:00"
FileAccessDate: "2023:04:18 00:01:59-07:00"
FileCreateDate: "2023:04:16 12:00:00-07:00"
FilePermissions: -rw-rw-rw-
FileType: JPEG
FileTypeExtension: jpg
MIMEType: image/jpeg
ExifByteOrder: "Big-endian (Motorola, MM)"
XResolution: 72
YResolution: 72
ResolutionUnit: inches
ModifyDate: "2023:04:17 23:16:29"
YCbCrPositioning: Centered
ExifVersion: 0232
DateTimeOriginal: "2023:04:17 23:16:29"
CreateDate: "2023:04:17 23:16:29"
ComponentsConfiguration: "Y, Cb, Cr, -"
FlashpixVersion: 0100
ColorSpace: Uncalibrated
XMPToolkit: "Image::ExifTool 12.60"
Description: ""My Description""
Title: title
ImageWidth: 1749
ImageHeight: 1205
EncodingProcess: "Baseline DCT, Huffman coding"
BitsPerSample: 8
ColorComponents: 3
YCbCrSubSampling: "YCbCr4:2:0 (2 2)"
And opening the file up in Libre Calc using the colon as the delimiter
(https://i.imgur.com/8v1yzU0.png)
This only works for one file, though. Additional files will be listed below, not in additional columns.
Quote from: StarGeek on April 18, 2023, 03:09:11 AMBTW Phil, the filter as written for Windows doesn't work. The qq needs 4 quotes
Thanks. I've updated the FAQ (https://exiftool.org/faq.html#Q12). Could you check to be sure I got it right?
- Phil
The or /:/ was for just this command. It's probably not needed in general.
Otherwise, looks good. And of course, PowerShell doesn't work with either
In CMD
C:\>exiftool -a -s -api filter="$_ = qq{""""$_""""} if s/""/""""/g or /(^\s+|\s+$)/ or /[,\n\r]/" -filename -directory -XResolution -ExifByteOrder -EncodingProcess -Description -Description# -Caption-Abstract -Caption-Abstract# y:\!temp\Test4.jpg
FileName : Test4.jpg
Directory : y:/!temp
XResolution : 72
ExifByteOrder : "Big-endian (Motorola, MM)"
EncodingProcess : "Baseline DCT, Huffman coding"
Description : ""My Description""
Description : "My Description"
Caption-Abstract : "Caption .With.Newline"
Caption-Abstract : Caption .With.Newline
Thanks. I've removed the or /:/
I'm not going to worry about PowerShell.
- Phil