List tag of files in subdirectories FILENAME WITH DIR

Started by eXMarty, January 04, 2020, 09:00:52 AM

Previous topic - Next topic

eXMarty

Hello,
I have a folder A with subfolders B and BB, these are JPG files.
I would like to list all file tags in subfolders so that I have a subfolder in addition to the file name.
With standard output, the directory is displayed, but I need an output table (-T Output in tabular format)

Files structure:

A\
B\
20150325_122513.jpg
20170105_155006 (DOOGEE 15182).JPG
20181017_114807.jpg
20181017_114911_PANO.jpg
BB\
125_2508.JPG
20080211_181843 (Sony Ericsson 05022).JPG
20130111_131945 (HTC 0318).jpg


Standard output:
exiftool -filename -DateTimeOriginal -dateFormat "%Y%m%d_%H%M%S" -r A

======== A/B/20150325_122513.jpg
File Name                       : 20150325_122513.jpg
Date/Time Original              : 20150325_122512
======== A/B/20170105_155006 (DOOGEE 15182).JPG
File Name                       : 20170105_155006 (DOOGEE 15182).JPG
Date/Time Original              : 20170105_155006
======== A/B/20181017_114807.jpg
File Name                       : 20181017_114807.jpg
Date/Time Original              : 20181017_114807
======== A/B/20181017_114911_PANO.jpg
File Name                       : 20181017_114911_PANO.jpg
======== A/BB/125_2508.JPG
File Name                       : 125_2508.JPG
Date/Time Original              : 20040103_113220
======== A/BB/20080211_181843 (Sony Ericsson 05022).JPG
File Name                       : 20080211_181843 (Sony Ericsson 05022).JPG
Date/Time Original              : 20080211_181843
======== A/BB/20130111_131945 (HTC 0318).jpg
File Name                       : 20130111_131945 (HTC 0318).jpg
Date/Time Original              : 20130111_131945
    3 directories scanned
    7 image files read


Table format:
exiftool -filename -DateTimeOriginal -dateFormat "%Y%m%d_%H%M%S" -T -r A

20150325_122513.jpg     20150325_122512
20170105_155006 (DOOGEE 15182).JPG      20170105_155006
20181017_114807.jpg     20181017_114807
20181017_114911_PANO.jpg        -
125_2508.JPG    20040103_113220
20080211_181843 (Sony Ericsson 05022).JPG       20080211_181843
20130111_131945 (HTC 0318).jpg  20130111_131945



I need this output:

A/B/20150325_122513.jpg     20150325_122512
A/B/20170105_155006 (DOOGEE 15182).JPG      20170105_155006
A/B/20181017_114807.jpg     20181017_114807
A/B/20181017_114911_PANO.jpg        -
A/BB/125_2508.JPG    20040103_113220
A/BB/20080211_181843 (Sony Ericsson 05022).JPG       20080211_181843
A/BB/20130111_131945 (HTC 0318).jpg  20130111_131945


Thanks in advance for your advice on how to achieve this.

Phil Harvey

Try this:

exiftool -p "$directory/$filename   $datetimeoriginal" -dateFormat "%Y%m%d_%H%M%S" -r A

where there is a tab before $datetimeoriginal.  Note that it may be tricky to get the tab on the command line.

- Phil
...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 ($).