How to output the directory path

Started by remarkableearth, November 21, 2017, 03:48:39 PM

Previous topic - Next topic

remarkableearth

I wish to output a csv with a set of tags, including the full (absolute) paths of the directories that hold the files since the files reside in a directory and all its subdirectories. I searched the documentation but couldn't find this. How do I get the output to include the full path of the directories?

In my code exiftool -csv -r -directory -basename -event_name -event_date . > output6.csv I get a dot for the directory in the csv rather than the path. (The tags -event_name and -event_date are custom and defined already.)

Second question: how can I suppress the output of Sourcefile in the csv?

Phil Harvey

The FilePath tag gives the absolute directory specification plus file name of the file.

You can't suppress the SourceFile column, but you can make this an absolute path (and avoid the need for FilePath) if you specify an absolute path on the command line instead of just ".".

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

remarkableearth

Thank you, Phil. I hadn't known about FilePath. The use of the absolute path instead of the dot (.) works in combination with -r to output the tags of all files in the directory and subdirectory.

However, how would I limit the output of only one filetype, such as JPGs? Specifying the path /directory/subdirectory/*.jpg throws the error: File not found: /directory/subdirectory/*.jpg.


Phil Harvey

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

remarkableearth

Of course. That's one I knew but hadn't recalled.

Thank you.