ExifTool Forum

ExifTool => Newbies => Topic started by: _rach_ on July 03, 2019, 11:41:56 AM

Title: Special feature: -csv+=CSVFILE
Post by: _rach_ on July 03, 2019, 11:41:56 AM
Hello everyone,

first thanks you for this exelent tools, i learn on it each days but this time i dont understand how to add -TAG to a CSVFILE without overwrite it.

i ve try this :

exiftool -keywords -csv /mydirectory/ > myfile.csv  it works well!

now when i try:

exiftool -IPTC:Caption-Abstract -ext jpg /mydirectory/ -csv+=/mycsvdirectory/myfile.csv

QuoteIgnored superfluous tag name or invalid option: -IPTC:Caption-Abstract
    1 directories scanned
   30 image files updated

i ve tried a lot of combinaison but i dont find the right thing.

thank you  :)


Title: Re: Special feature: -csv+=CSVFILE
Post by: StarGeek on July 03, 2019, 12:12:57 PM
A CSV file cannot be updated with new information by exiftool. 

A workaround would be to create a new csv file with the info you wish to add and then merge it either through a spreadsheet program like Excel or OpenOffice Calc, or something like CSVKit (https://csvkit.readthedocs.io/en/1.0.2/index.html) on the command line.
Title: Re: Special feature: -csv+=CSVFILE
Post by: _rach_ on July 03, 2019, 12:15:04 PM
Quote from: StarGeek on July 03, 2019, 12:12:57 PM
A CSV file cannot be updated with new information by exiftool. 

A workaround would be to create a new csv file with the info you wish to add and then merge it either through a spreadsheet program like Excel or OpenOffice Calc, or something like CSVKit (https://csvkit.readthedocs.io/en/1.0.2/index.html) on the command line.

Ooooh ok :/

thanks for the quick reply!
Title: Re: Special feature: -csv+=CSVFILE
Post by: _rach_ on July 03, 2019, 01:02:31 PM
then you mean that we can do :

exiftool [option] -csv+=CSVFILE  /mydirectory/CSVFILE2

?
Title: Re: Special feature: -csv+=CSVFILE
Post by: StarGeek on July 03, 2019, 01:13:51 PM
That command will update all the files in  /mydirectory/CSVFILE2 that have a corresponding entry in CSVFILE with the metadata in CSVFILE.  In other words, it will import data from the csv file to the image files.  The use of += will is a special case for list type tags in the image files, such as keywords.  For example, if IMG_001.jpg has keywords John, Jane, and Alex, and the CSV file has Laura under keywords, then -csv+=CSVFILE means that Laura will be added to the keywords, resulting in John, Jane, Alex, and Laura, whereas -csv=CSVFILE means that the previous keywords would be overwritten and Laura would be the only keyword in the file.

If you need to add new data to a CSV file, you need to either run a command to create a new CSV file or edit the old one by hand.
Title: Re: Special feature: -csv+=CSVFILE
Post by: _rach_ on July 03, 2019, 02:40:51 PM
Thanks for this explain.

So,I ve find what i need  :P:

exiftool -tagsfromfile %d%f.jpg '-DestTAG<SrcTAG' /mydirectory/

that copy each tag from file to file with the same sourcefile.