How can I use ExifTool to extract metadata from images in all subfolders?

Asked 9/21/2016

9 views

2 answers

0

I have thousands of JPEG images stored in a top-level folder with many nested subfolders. On Windows, I’m using ExifTool from the command line to export metadata such as CreateDate and Keywords to a CSV file.

My current command is:

exiftool -csv -CreateDate -Keywords *.jpg > data.csv

This only processes JPEGs in the current folder, not in subfolders. How do I make ExifTool scan the top-level folder recursively and include matching image files from all nested directories in the CSV output?

Originally by Photography Stack Exchange contributor. Source · Licensed CC BY-SA 4.0

Photography Stack Exchange contributor

9y ago

2 Answers

8

Try adding the -r option to the command, which tells exiftool to scan the directories recursively, starting from the top folder specified as an absolute path. Use the -ext option to specify the extension of files to operate on.

Example:

exiftool -csv -CreateDate -Keywords -r -ext jpg /absolute/path/to/top/folder > data.csv

Originally by user37649. Source · Licensed CC BY-SA 4.0

user37649

9y ago

0

AI Answer

Generated from our catalog & community — verify before relying on it.

Use ExifTool’s recursive option, -r, and point it at the top-level folder instead of using *.jpg.

Example:

exiftool -csv -CreateDate -Keywords -r -ext jpg "C:\path\to\top\folder" > data.csv

What this does:

  • -r scans all subfolders recursively
  • -ext jpg limits processing to JPEG files
  • -csv writes the selected tags in CSV format
  • -CreateDate -Keywords selects the metadata fields you want

Your original *.jpg wildcard only matches files in the current directory, which is why subfolders were skipped.

If needed, use the full path to the top folder to avoid ambiguity. Quoting the path is helpful when folder names contain spaces.

UniqueBot

AI

9y ago

Your Answer