Question About Batch Imports

Started by newoski, May 21, 2020, 03:37:50 PM

Previous topic - Next topic

newoski

First, thanks for this tool. It's amazing! I'm currently using it to export and import metadata to large volumes of photos. While there are tons of photos, I'm only really changing one or two parameters -- for example Keywords. When using the command below, do I need to include ALL the columns in the CSV that are present in an exiftool export, or can I simply have 2 columns: SourceFile and Keywords?

Recapped more simply, if I have a CSV with two columns, SourceFile and Keywords, will the command below add the Keywords to the images listed in SourceFile or do I need any additional Columns to meet a minimum requirement?

exiftool -csv=keywords.csv "path\to\photos"


StarGeek

Quote from: newoski on May 21, 2020, 03:37:50 PMRecapped more simply, if I have a CSV with two columns, SourceFile and Keywords, will the command below add the Keywords to the images listed in SourceFile?

exiftool -csv=keywords.csv "path\to\photos"

Yes, you can use only two columns as you have listed and it will only affect the tags you have headers for.

But...
There are two things you need to be aware of when writing to Keywords.  First, using the command you list will not add the keywords, it will completely overwrite any existing keywords.  So if there are already keywords in the file that are different from the CSV file, they will be lost.  You can avoid this by adding a + directly after the CVS.
exiftool -csv+=keywords.csv "path\to\photos"

Secondly, this command will store anything in the keywords column as a single keywords, not as separate keywords.  For example, if you have Dog, Cat, Canary in the keywords column, it will be saved into the files as one long keyword
Dog, Cat, Canary
instead of individual keywords as it should be
Dog
Cat
Canary


To correct this, you need to add the -sep option.  So a complete command would be
exiftool -csv+=keywords.csv -sep ", " "path\to\photos"
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

newoski

Quote from: StarGeek on May 21, 2020, 03:47:50 PM
Quote from: newoski on May 21, 2020, 03:37:50 PMRecapped more simply, if I have a CSV with two columns, SourceFile and Keywords, will the command below add the Keywords to the images listed in SourceFile?

exiftool -csv=keywords.csv "path\to\photos"

Yes, you can use only two columns as you have listed and it will only affect the tags you have headers for.

But...
There are two things you need to be aware of when writing to Keywords.  First, using the command you list will not add the keywords, it will completely overwrite any existing keywords.  So if there are already keywords in the file that are different from the CSV file, they will be lost.  You can avoid this by adding a + directly after the CVS.
exiftool -csv+=keywords.csv "path\to\photos"

Secondly, this command will store anything in the keywords column as a single keywords, not as separate keywords.  For example, if you have Dog, Cat, Canary in the keywords column, it will be saved into the files as one long keyword
Dog, Cat, Canary
instead of individual keywords as it should be
Dog
Cat
Canary


To correct this, you need to add the -sep option.  So a complete command would be
exiftool -csv+=keywords.csv -sep ", " "path\to\photos"

Wow, that was an amazingly helpful reply. Thanks so much!!!