ExifTool Forum

ExifTool => Newbies => Topic started by: ronseese on July 03, 2019, 01:58:14 PM

Title: How to specify exif metadata to include in csv file
Post by: ronseese on July 03, 2019, 01:58:14 PM
New user here.
These commands work great, as they create a csv file from my collection:
exiftool -r -a -csv pictures > all.csv
and
exiftool -r -common -csv pictures > common.csv

I would like to customize the fields which are in the csv file, I have a list of exif tags that I would like to include, there are 37 of them. How would I compose the command line?
Thanks, Ron

Title: Re: How to specify exif metadata to include in csv file
Post by: StarGeek on July 03, 2019, 02:14:50 PM
You would specify the tags on the command line.
exiftool -r -TAG1 -TAG2 -TAG3 -csv pictures > common.csv

37 tags might get a bit unwieldy, so you could look into creating an arg file (see -@ (Argfile) option (https://exiftool.org/exiftool_pod.html#ARGFILE)), which would look like this
-r
-csv
-TAG1
-TAG2
-TAG3

and then you would call the arg file from the command line
exiftool -@ Argfile.Args /Pictures/ >common.csv

You have to make sure you use the actual tag names (see -s (short) option (https://exiftool.org/exiftool_pod.html#s-NUM--short) and FAQ #2 (https://exiftool.org/faq.html#Q2)) not the description names.
Title: Re: How to specify exif metadata to include in csv file
Post by: ronseese on July 03, 2019, 02:23:57 PM
That worked perfectly, almost, I had to move the -r to the command line and not the argument file, complained about it being a TAG.
Thanks!
Now I just need to do some data analysis to find out my favorite focal length.
Nice tool, BTW.
Ron
Title: Re: How to specify exif metadata to include in csv file
Post by: StarGeek on July 03, 2019, 03:26:57 PM
Quote from: ronseese on July 03, 2019, 02:23:57 PMcomplained about it being a TAG.

You probably had a leading or trailing whitespace.  This makes a difference in an arg file.  Arg files have to be exact and without quotes, unlike the command line.
Title: Re: How to specify exif metadata to include in csv file
Post by: ronseese on July 03, 2019, 03:41:33 PM
Quote from: StarGeek on July 03, 2019, 03:26:57 PM
Quote from: ronseese on July 03, 2019, 02:23:57 PMcomplained about it being a TAG.

You probably had a leading or trailing whitespace.  This makes a difference in an arg file.  Arg files have to be exact and without quotes, unlike the command line.

ok, thanks.