ExifTool Forum

ExifTool => Newbies => Topic started by: Rgn on January 07, 2021, 11:33:19 AM

Title: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Rgn on January 07, 2021, 11:33:19 AM
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
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Phil Harvey on January 07, 2021, 12:04:23 PM
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
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: 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?

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.
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: StarGeek on January 08, 2021, 12:05:23 PM
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.
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Rgn on January 12, 2021, 12:25:25 PM
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.
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Phil Harvey on January 12, 2021, 01:15:39 PM
What exactly is the SourceFile entry for this file in the CSV?

- Phil
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Rgn on January 13, 2021, 11:03:10 AM
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?
Title: Re: Trying to use ExifTool to batch apply metadata to folder of JPEGs
Post by: Phil Harvey on January 13, 2021, 03:38:32 PM
Yes.  That is the problem.

- Phil