Batch Import Metadata from CSV as a template

Started by rainerzufahl, June 30, 2020, 04:23:08 AM

Previous topic - Next topic

rainerzufahl

Hello guys,

I have a non-electronic prime lens, and I want to write the lenses metadata to all images taken with that lens. This includes tags like LensInfo, Aperture, FocalLength and so on.

I have already generated a .csv from a different lens and changed the values I need. What I now struggle with is importing this set of data, that is the same for all images processed, to all the images. When using comands like
exiftool -r -overwrite_original -csv="path/to/csv" "path/to/images"
give back the error
No source file found
which makes sense because the data isn't bound to any specific file, and I didn't create a "SourceFile" Column.

I hope I've explained this problem well enough, but let me know if you need any further information. I'd love to get this thing working!

Thanks so much for your help,
Rainer

Phil Harvey

Hi Rainer,

Create a SourceFile column and put a "*" in it.

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

rainerzufahl

Hello Phil, thank you for the fast respone!

After some testing, that solution works. But I've run into a new issue now:

I want to use the Windows executable that I can drop files onto to process. The current name of that executable is:
exiftool(-k -r -overwrite_original -csv=Metadata_Helios.csv).exe
When the images I drop on that exe are in the same folder as the exe, this works fine. But when dropping files from other folders, the "No SourceFile" error pops up.

As I want to be able to batch process images after shooting with the manual lens, I wouldn't want to copy all the images to the exe, process them, then copy them back. Is there any way to solve this?

Again, thanks so much for your help.

Rainer

Phil Harvey

Hi Rainer,

I suspect that the proper Metadata_Helios.csv file is not being loaded.  Unfortunately you can't put the full pathname in the brackets of the .exe file, so either a shortcut or a .bat file is the solution.

For the .bat file:

c:/path/to/exiftool/exiftool.exe -k -r -overwrite_original -csv=c:/path/to/csvfile/Metadata_Helios.csv %*

Then drop the files on the .bat file.

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

rainerzufahl

This solution works! While it is a bummer that the console windows doesn't show any progress, I'm still very happy.

Out of interest, what's the "%*" at the end of the bat command doing?

Rainer

StarGeek

What does %* mean in a batch file?
It means "all the parameters in the command line".

It's basically all the filenames you drop onto the bat file.
* 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).

Phil Harvey

Hi Rainer,

Add -progress to the command to show progress.  There are various features available with the -progress option that are described in the documentation.

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