exporting to csv

Started by Christian_123, April 15, 2022, 07:24:57 AM

Previous topic - Next topic

Christian_123

Hi all,

I'm from Germany and a new user of this forum. Reading a lot of posts regarding the topic 'export EXIF-data to a readable document' - e.g. to csv I found a lot of information - but it doesn't work :-(

EXIFtool ist located in a separate directory of my WIN10 computer and I create some links in the same directory to handle different issues. To start the operation I just drag&drop a selection of files direct on the link - the command window of WIN10 opens and show me the content of the EXIF data.


This will work (displaying on the screen):

***Properties of the link:
D:\Progs\ExifTool\exiftool.exe -filename -DateTimeOriginal -CreateDate -ModifyDate -pause

***Result for 2 dragged files:
======== C:/Temp/Puffer_Foto/IMG_2.JPG
File Name                       : IMG_2.JPG
Date/Time Original              : 2022:02:19 18:17:44
Create Date                     : 2022:02:19 18:17:44
Modify Date                     : 2022:02:19 18:17:44
======== C:/Temp/Puffer_Foto/IMG_1.JPG
File Name                       : IMG_1.JPG
Date/Time Original              : 2022:02:19 16:06:55
Create Date                     : 2022:02:19 16:06:55
Modify Date                     : 2022:02:19 16:06:55
    2 image files read
-- press ENTER --


This don't work to get the results in a file:

***Properties of the link:
D:\Progs\ExifTool\exiftool.exe -csv > info.csv -filename -DateTimeOriginal -CreateDate -ModifyDate -pause

***Result for 2 dragged files:
Error: File not found - info.csv
SourceFile,FileName,DateTimeOriginal,CreateDate,ModifyDate
C:/Temp/Puffer_Foto/IMG_2.JPG,IMG_2.JPG,2022:02:19 18:17:44,2022:02:19 18:17:44,2022:02:19 18:17:44
C:/Temp/Puffer_Foto/IMG_1.JPG,IMG_1.JPG,2022:02:19 16:06:55,2022:02:19 16:06:55,2022:02:19 16:06:55
    1 directories scanned
    2 image files read
    1 files could not be read
-- press ENTER --

I tried some other syntax, because in the samples of the forum it explained in different ways:
- Is it neccessary to have a space between the '>' and the targetfilename: '> info.csv' or '>info.csv'?
- where is the right location or the targetfilename: behind the '-csv' option or at the end of the parameter string?
- why I get the message that the target file doesn't exists? I expect that the file should be allocated automatically?
- in which directory the targetfile will be allocated?

At least: what is the right syntax for the Link/Icon to export the requested EXIF-Para into a csv-file?

Thanks in advance for your support
Christian

StarGeek

#1
Quote from: Christian_123 on April 15, 2022, 07:24:57 AMAt least: what is the right syntax for the Link/Icon to export the requested EXIF-Para into a csv-file?

There is none.  What is necessary is to do it on the command line.

The > is a shell redirection and is property of the command line.  It is not something that exiftool does and it does not exist in a Windows shortcut.  What you need to do is instead create a BAT file with your command.  There the redirection can take place.

Your BAT file would be something like
exiftool.exe -csv -filename -DateTimeOriginal -CreateDate -ModifyDate -pause %* >info.csv

You could then drag/drop files onto the BAT file.

edit: answered questions for completeness.

Quote- Is it neccessary to have a space between the '>' and the targetfilename: '> info.csv' or '>info.csv'?

No, either of those would work.  I prefer to not have any spaces between but that's just because I like things more compact.

Quote- where is the right location or the targetfilename: behind the '-csv' option or at the end of the parameter string?

Anywhere works, just as long as you are not splitting an option that requires a second parameter.  For example, the -d (-dateFormat) option requires the next argument to be the format for the -d option to use, e.g. -d "%Y-%m-%d_%H.%M.%S%%+c.%%e".

Quote- in which directory the targetfile will be allocated?

Using a BAT file, it will appear in the same directory as the BAT file unless you provide a path.  For example, you could use >C:\Data\Spreadsheets\info.csv and it would appear in that directory.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Christian_123

Thank you very much for the fast and complete answer  :) :) :)
It works perfect! - Last small question: is it possible to change the delimter from a comma ',' to a ';' or a 'Tab forward'?

Christian

StarGeek

Not with the -csv option.  You can try the -T (-table) option or create your own format with the -p (-printFormat) option.  Also see FAQ #12.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Christian_123

Thank you again - I found a solution that works  :)