show directory/path in recursive listing

Started by marcb, July 12, 2014, 01:05:31 AM

Previous topic - Next topic

marcb

Hi,

I need a recursive listing of pics in a directory tree to import in excel including the full path of the pictures.

Using -t I get a listing that shows the subdirectories, but the data are not well ordered for easy import.

H:\Pictures\test>exiftool  -t -r -filename -createdate -iso -aperture -shutterspeed *

======== m107157.jpeg
File Name       m107157.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== m107158.jpeg
File Name       m107158.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== subdir/m107160.jpeg
File Name       m107160.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50
======== subdir/m107161.jpeg
File Name       m107161.jpeg
Create Date     2013:01:30 09:48:43
ISO     800
Aperture        4.5
Shutter Speed   1/50


Using -T the data are well ordered, but the output doesn't show path or subdirectories.

H:\Pictures\test>exiftool  -T -r -filename -createdate -iso -aperture -shutterspeed *

m107157.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107158.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107160.jpeg    2013:01:30 09:48:43     800     4.5     1/50
m107161.jpeg    2013:01:30 09:48:43     800     4.5     1/50


I've been unable to find a way to include the path or even the subdirectory names in the output. How do I do that?

tnx
marc

Hayo Baan

You get the path using -directory.

Hope this helps,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl

marcb

tnx for taking the time to help out a newbie!

Hayo Baan

Hayo Baan – Photography
Web: www.hayobaan.nl

Hayo Baan

Oh, and if you want to go fancy, you can create your own composite tag for the full filename as well. Just put the following code in your .ExifTool_config file (or create one in your home directory if you don't yet have one.

%Image::ExifTool::UserDefined = (
  'Image::ExifTool::Composite' => {
    FullFileName => {
      Require => {
        0 => 'Directory',
        1 => 'FileName',
      },
      ValueConv =>
        'my $f = ($val[0] =~ s#^\./?##r); $f .= "/" if $f; $f .= $val[1]',
    },
  },
);


With that code you can now use -FullFileName if you want the full file spec, including directory  8)

Have fun,
Hayo
Hayo Baan – Photography
Web: www.hayobaan.nl