columns and rows

Started by lionmonkey, February 06, 2012, 11:22:16 PM

Previous topic - Next topic

lionmonkey

I am trying to export the  filename, createdate and subect for a folder of images to a single text or xls file

using this command F:\20111129FT>exiftool.exe -createdate -subject *jpg >dump.txt I can get a file that lists the filename, createdate and subject on seperate rows but I do not know how to re-arrange these into a file that would have a single row for each image and seperate column for each tag. I have thousands of images so a manual fix is not my preferred solution. Apologies if this has been dealt with before I couldn't find anything directly relevant by searching

Here is what I have and don't want and beneath that is what I would want

======== PICT0001.JPG
Create Date                     : 2011:10:20 13:23:56
Subject                         : [1 pig]
======== PICT0002.JPG
Create Date                     : 2011:10:20 13:23:57
Subject                         : [1 pig]
======== PICT0003.JPG
Create Date                     : 2011:10:20 13:23:58
======== PICT0004.JPG
Create Date                     : 2011:10:21 21:05:59
Subject                         : [nothing]
======== PICT0005.JPG
Create Date                     : 2011:10:21 21:06:00
Subject                         : [nothing]
======== PICT0006.JPG
Create Date                     : 2011:10:21 21:06:01
Subject                         : [nothing]
======== PICT0007.JPG
Create Date                     : 2011:10:22 03:09:47
======== PICT0008.JPG
Create Date                     : 2011:10:22 03:09:48
Subject                         : [nothing]
======== PICT0009.JPG
Create Date                     : 2011:10:22 03:09:49
Subject                         : [nothing]
======== PICT0010.JPG
Create Date                     : 2011:10:22 05:03:52
Subject                         : [1 pig]


Picture ID           Createdate                     Subject
PICT0010.JPG    2011:10:22 03:09:49      [1 pig]
PICT0009.JPG    2011:10:21 03:09:49      [nothing]

If anyone can help I will owe them a month of my life, of course I won't be making good on this debt but at least you'll have a warm fuzzy feeling.

Graham





BogdanH

Hi Graham,

You should export metadata into CSV (comma separated values) file, i.e.:
F:\20111129FT>exiftool.exe -createdate -subject -csv *.jpg >dump.csv
..here, each file (with tag values) has it's own row, where first row contain column names and tag values are separated by comma. If some file doesn't contain particular tag (no value), then just commas will be written, without space inbetween.
If you wish that column is populated even tag doesn't exist, then use -f (force) option:
F:\20111129FT>exiftool.exe -f -createdate -subject -csv *.jpg >dump.csv
..in this case, if tag value doesn't exist for particular column, a minus sign "-" will be written there.

Bogdan

Phil Harvey

...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Thomas

Hi, Phil,

ExifTool is a great piece of software with so many features! Thanks a lot sharing it!

I hestitated to ask the following question in the forum as the solution must be so obvious but suddenly Graham made the first move. I'm a newbie...

When I use the command exiftool -filename -shutterspeed -aperture -csv *.jpg > picturedata.csv I get the same result as Graham did. I read FAQ number 12 and the postings concerning the -csv option in the forum.

(By the way, am I correct that FAQ number 12's example exiftool -csv -r t/images > out.csv does not suggest mandatory use of a file specification like *.jpg ? Omitting the specification gets me the error message "No file specified".)

Sorry to ask this question but somehow I don't see the wood for the trees...

Greetings and thanks for your help and patience,
Thomas

Phil Harvey

Hi Thomas,

Quote from: Thomas on February 07, 2012, 03:24:33 PM
When I use the command exiftool -filename -shutterspeed -aperture -csv *.jpg > picturedata.csv I get the same result as Graham did.

What version of ExifTool are you using?  The -csv option was added in version 8.51.

Quote(By the way, am I correct that FAQ number 12's example exiftool -csv -r t/images > out.csv does not suggest mandatory use of a file specification like *.jpg ? Omitting the specification gets me the error message "No file specified".)

When a directory name is specified (t/images in this command), all recognized file types are processed.  But the -ext option may be used to process only specific types.

I hope this answers your questions.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

lionmonkey


Thomas

Hi, Phil,

I admit that I download ExifTool via GeoSetter which works fine. As GeoSetter always reports the availability of new ExifTool versions I assume that I've got the latest version of ExifTool. (At the moment I can't check this.) I am aware of the -csv option being rather new (2011?, thanks for that, doing a csv-export seems to have been a bit more work before you introduced that option).

ExifTool enabled me to "repair" incorrect maker notes via importing correct ones from original files - but my csv-export problem confuses me. I haven't tried to use the -T or -t options yet, perhaps that might be an alternative (or do you strictly recommend csv?).

I have catched the point concerning the file specification. Thanks for explaining this to me!

Thomas

BogdanH

Hi Thomas,

Quote from: Thomas on February 08, 2012, 06:10:09 AM
...I download ExifTool via GeoSetter which works fine. As GeoSetter always reports the availability of new ExifTool versions I assume that I've got the latest version of ExifTool. (At the moment I can't check this.) I am aware of the -csv option being rather new (2011?, thanks for that, doing a csv-export seems to have been a bit more work before you introduced that option).

As far I can see, latest GeoSetter dates from Jan.30,2011; ExifTool v8.51 (where -csv option was added) however, was made on Mar.12,2011 -that is, if the only ExifTool you have is the one supplied with GeoSetter, then -csv can't work. At the end, why guessing: just download latest ExifTool.

Bogdan

Thomas

Hi, Bogdan,

thanks for providing the information! Your're completly right: I'll check the version later the day when I'm home and report (of course, knowing that usually questions related to other software are not this forum's "business").

Greetings,
Thomas

Thomas

Hi, Phil and Bogdan,

after downloading it directly from owl.phy.queensu.ca using ExifTool version 8.77 provides the desired results... Again: Thanks a lot!

Thomas