ExifTool Forum

ExifTool => Newbies => Topic started by: gcotterl on September 23, 2017, 01:55:07 PM

Title: Extracting data about image files and creating output file
Post by: gcotterl on September 23, 2017, 01:55:07 PM
I want to use EXIFTOOL to extract the datetimeoriginal for all jpg, jpeg and png files in the parent directory and its subfolders and create an output file in the parent directory.

In DOS, I'm in the parent directory C:\Users\Gary\every photo

and I'm running:

exiftool -r *.jpg *.jpeg *.png -datetimeoriginal > newjpg.txt

But the newjpg.txt file is empty.

What do I have wrong?
Title: Re: Extracting data about image files and creating output file
Post by: StarGeek on September 23, 2017, 02:41:25 PM
See -r docs (https://exiftool.org/exiftool_pod.html#r-.--recurse) and Common Mistake 2 (https://exiftool.org/mistakes.html#M2).

Wildcards don't work with -r.  Use -ext (https://exiftool.org/exiftool_pod.html#ext-EXT---ext-EXT--extension) instead and either a dot . for the current directory or a more complete directory path "C:\Users\Gary\every photo" (quotes are needed due to the space in the path).

exiftool -r -ext jpg -ext jpeg -ext png -datetimeoriginal  . > newjpg.txt
Title: Re: Extracting data about image files and creating output file
Post by: gcotterl on September 23, 2017, 04:41:51 PM
In the COMMAND PROMPT screen, I using:

exiftool -csv -T -r -ext jpg -ext jpeg -ext png -filepath -datetimeoriginal -DateTaken -FileModifyDate -FileAccessDate -FileCreateDate -ModifyDate -CreateDate -make -model -filesize -imagesize -megapixels . > newjpg.txt


At the beginning of the output, why are "./ and ./ appearing before folder name?

For example:

"./CHRISTMAS                                 
"./HAYDEN, MARYANN, STEVE & JENN             
"./ITALY - VENICE                             
./ARCHES NATIONAL PARK                       
./AZTEC NATIONAL MONUMENT                     
./BIKE                                       
                                   
Title: Re: Extracting data about image files and creating output file
Post by: Hayo Baan on September 23, 2017, 05:33:36 PM
The quote because of the spaces in the directory name, the dot to indicate the current directory :)
Title: Re: Extracting data about image files and creating output file
Post by: gcotterl on September 23, 2017, 05:43:18 PM
CHRISTMAS doesn't contain a space.
Title: Re: Extracting data about image files and creating output file
Post by: StarGeek on September 23, 2017, 07:30:58 PM
See the docs on the -csv option (https://exiftool.org/exiftool_pod.html#csv-CSVFILE). The first column should contain the path+filename based upon the directory given.  This is the SourceFile column and contains the path plus the filename. It is included for when you want to use the CSV file to import metadata back into the files.

The second column should contain the filepath data you are looking for.

CHRISTMAS may not contain a space, but there probably is one in the rest of that entry.

If you don't want the Sourcefile column, you can either edit it out yourself by importing into OpenOffice or using CSVKit (requires python).  Or you can roll your own CSV using the the -p (https://exiftool.org/exiftool_pod.html#p-FMTFILE-or-STR--printFormat) option.
Title: Re: Extracting data about image files and creating output file
Post by: gcotterl on September 23, 2017, 07:43:55 PM
CHRISTMAS has no leading or trailing space.
Title: Re: Extracting data about image files and creating output file
Post by: StarGeek on September 23, 2017, 08:01:44 PM
Can you list first few rows here so we can see what might be causing this?