ExifTool Forum

ExifTool => Newbies => Topic started by: UASPilot256 on February 19, 2021, 02:22:10 PM

Title: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 02:22:10 PM
I am using the following exiftool executable and getting the attached csv output. Most everything (labels and data) are lumped together into Column A. How do I get this to be exif field names in Row 1 and the associated data in row 2? Or Exif field names in column A and data in column B?


exiftool(-a -m -u -w csv).exe

Thanks!
Title: Re: Exiftool Executable csv output formatting
Post by: Phil Harvey on February 19, 2021, 02:26:14 PM
You forgot the -csv option.  Try this:

exiftool(-a -m -u -w csv -csv).exe

- Phil
Title: Re: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 02:45:14 PM
Hi Phil,
I am not getting a "Error: File not found - csv" message.
Title: Re: Exiftool Executable csv output formatting
Post by: Phil Harvey on February 19, 2021, 02:48:05 PM
Watch the order of the arguments.
Title: Re: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 02:56:36 PM
I followed what you suggested, but added a -k to see the data. Took out the -w as it was throwing an error when used with -csv as well. Field names and data show up in command line but is preceded by that same error message. Followed by "1 images files read", "1 files could not be read".

exiftool(-k -a -m -u csv -csv).exe
Title: Re: Exiftool Executable csv output formatting
Post by: Phil Harvey on February 19, 2021, 03:13:08 PM
The -w option requires an argument giving the file extension, so it must appear as -w csv

- Phil
Title: Re: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 03:20:37 PM
Got it. So leaving out the -w for now, because I'm still having issues. I've now used these arguments, it generates data in the command line view, but after pressing enter, no .csv file is saved to the location.

exiftool(-k -a -m -u -csv).exe
Title: Re: Exiftool Executable csv output formatting
Post by: Phil Harvey on February 19, 2021, 03:28:38 PM
Ah, right:

> exiftool a.jpg -k -a -m -u -csv -w csv
Sorry, -w may not be combined with -csv


This is because of the way -csv functions on multiple files.

Typically the -csv option is used only for multiple files, but the -w option is designed to have one output file for each source file.

Are you doing this on one file at a time?  If doing it for multiple files, where do you want the output file and what do you want it named?  For this you could use a Windows .bat file and redirect the output to a file.

- Phil

Title: Re: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 04:24:37 PM
I've been testing with 1 input file, but will be eventually using it for multiple input files, written out to 1 csv file.

So for multiple files, I should be able to drop a folder of images on a .bat file, with the below code, and have it export to a csv right?

exiftool.exe -k -a -m -u -csv > output.csv

When I do the above a csv is generated but is blank.
Title: Re: Exiftool Executable csv output formatting
Post by: StarGeek on February 19, 2021, 04:36:24 PM
You need to add %* so the filenames get passed.

See this StackOverflow question (https://stackoverflow.com/questions/16144716/what-does-mean-in-a-batch-file).
Title: Re: Exiftool Executable csv output formatting
Post by: UASPilot256 on February 19, 2021, 04:39:56 PM
Yes! Thank you Phil and StarGeek! Much appreciated.