Main Menu

-r and -csv problems

Started by Jim Rendant, October 17, 2023, 09:12:55 PM

Previous topic - Next topic

Jim Rendant

I used Exiftool GUI to determine what data I want. -System:direcory -Exif:model -IFD0:Orientation -Exif:imageHeight -Exif:imageWidth

My files are store in a treelike structure
2023
-----September
---------03
----------(files)

With the -r option could I start at the top level and recursively walk the tree and exam the files exporting the files listed above to a .csv file?

I treid the command line
exiftool -r -csv c:\exiftool -System:directory -Exif:model -IFD0:Orientation -Exif:imageHeight -Exif:imageWidth y:* > output.csv

If I understand the -csv file uses the (directory) and at the end of the argument list you redirect the output to >(output file)

if I cannot do this recursively should I create a perl or PHP program to accomplish this?

StarGeek

Quote from: Jim Rendant on October 17, 2023, 09:12:55 PMWith the -r option could I start at the top level and recursively walk the tree and exam the files exporting the files listed above to a .csv file?

I treid the command line
exiftool -r -csv c:\exiftool -System:directory -Exif:model -IFD0:Orientation -Exif:imageHeight -Exif:imageWidth y:* > output.csv

If I understand the -csv file uses the (directory) and at the end of the argument list you redirect the output to >(output file)

Your command is committing Common Mistake #2, Over-use of Wildcards in File Names. The -r (-recurse) option only works if you use a directory name, not a wildcard.  If you wanted to process every file on Y:\ then your command would be
exiftool -r -csv c:\exiftool -System:directory -Exif:model -IFD0:Orientation -Exif:imageHeight -Exif:imageWidth y:\ > output.csv
and the output would be in output.csv in the current directory.

Ah, I notice that you actually are setting two directories, though that may not be your intention.  The command as written will search files in c:\exiftool and y:\.  You would only put a filename after -csv if you wanted to read a csv file to write data, and then it would need an equal sign, e.g. -csv=output.csv.

Also, I would suggest using just -ImageHeight -ImageWidth. Exif:imageHeight/Exif:imageWidth are tags in the EXIF group and might not be the correct dimensions.  They have to be specifically set by whatever program is used, and many simple programs won't update them.  By using the simpler tag names without the group, you will get the actual image dimensions.

The -csv option can use a lot of memory, as it has to buffer all the file data.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype