Trying to use ExifTool to batch apply metadata to folder of JPEGs

Started by Rgn, January 07, 2021, 11:33:19 AM

Previous topic - Next topic

Rgn

Hello, I am a newbie and not a programmer. I'm trying to apply metadata from a CSV file to a folder of JPEGs. Both the CSV file and JPEG folder are in the same directory. But when I tried to run the command I got messages saying there was an error opening the CSV file and no file was specified. 
I'm working on Windows 10 on a PC.
The csv file is called: Kessler_metadata_2.csv
The folder of images is called: KESImages_2

C:\Users\rgnew>exiftool -csv="c:\Users\rgnew\Documents\Kaminer\Kessler_metadata_2.csv"Error opening CSV file"c:\Users\rgnew\Documents\Kaminer\KESImages_2\" No file specified

Phil Harvey

Your command looks to be mixed up with the error messages in your post.  The command should be something like this:

exiftool -csv="c:\Users\rgnew\Documents\Kaminer\Kessler_metadata_2.csv" "c:\Users\rgnew\Documents\Kaminer\KESImages_2"

And the CSV file will need a first column with a heading of "SourceFile" and entries with full path names like "c:/Users/rgnew/Documents/Kaminer/KESImages_2/image.jpg" etc.

- 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 ($).

Rgn

Thanks, Phil. Do I need to specify the location of exiftool.exe in the command? Currently, it is in a subfile of Users. Should it be somewhere else instead?

And thanks for the tip about the SourceFile column. We have that set up properly but it was not the first column so I just fixed that.

StarGeek

Quote from: Rgn on January 08, 2021, 11:28:26 AM
Thanks, Phil. Do I need to specify the location of exiftool.exe in the command? Currently, it is in a subfile of Users. Should it be somewhere else instead?

It has to be in a directory that is part of the PATH env variable.  If you type exiftool -ver and you get output that states the version number of exiftool, then it's in the right place.  Otherwise, you need to give the full path to the program.
* 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).

Rgn

Moving right along here, thanks to your advice! Now the exif.exe is being found but it can't seem to find the SourceFile in my csv file. Here is the error message:

C:\Users\rgnew\exiftool -csv="c:\Users\rgnew\Documents\Kaminer\Kessler_metadata_2.csv" "c:\Users\rgnew\Documents\Kaminer\KESImages_2"

No SourceFile 'C:Users/rgnew/Documents/Kaminer/KESImages_2/KES102.jpg in imported CSV database
(full path: 'c:/users/rgnew/documents/kaminer/kesimages_2/kes102.jpg')


The first column of the csv file is SourceFile. Both the csv file and the corresponding images are named correctly and in the directory specified. Any idea of what might be going wrong? Thanks.

Phil Harvey

What exactly is the SourceFile entry for this file in the CSV?

- 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 ($).

Rgn

Well, yes :-[ I had a naming error in the source file. But I just corrected it and got the same error message. Here is what I just tried to run with corrected folder name:

C:\Users\rgnew\exiftool -csv="c:\Users\rgnew\Documents\Kaminer\Kessler_metadata_2.csv" "c:\Users\rgnew\Documents\Kaminer\KESImages2"

This is the source file entry for c:/users/rgnew/documents/kaminer/kesimages2/KES102.jpg:

c:\Users\rgnew\Documents\Kaminer\KESImages2\ KES102.JPG

Once again, I got
No SourceFile 'c:/Users/rgnew/Documents/Kaminer/KESImages2/KES102.jpg' in imported CSV database
(full path: 'c:/users/rgnew/documents/kaminer/kesimages2/kes102.jpg')


Now I see that when I concatenated columns in Excel, a space got inserted here in the SourceFile column:
c:\Users\rgnew\Documents\Kaminer\KESImages2\ KES102.JPG

This might be the problem, right?

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 ($).