ExifTool Forum

General => Metadata => Topic started by: webowner on May 19, 2014, 01:12:57 AM

Title: Import Excel - Photo Captions
Post by: webowner on May 19, 2014, 01:12:57 AM
Hi Phil,

It's been a long time, but I hope you remember me... Owner of web business, and Professional Photographer.

I have used your ExifTool system in the past to export thousands of photo captions, and now I have them in a Microsoft Excel file.

Now, I am in desperate need to IMPORT these photo captions back onto my photos using either Adobe Lightroom or Zoner Photo Studio (Have you heard of Zoner?)

How exactly do I do this?

The Excel sheet is broken down into columns using these fields:
00450004.JPG       Bow River looking towards downtown Calgary     00450004.JPG   2008-11-13 14:55

Column 1 - Image name
Column 2 - Photo Caption
Column 3 - Image Name
Column 4 - Date

Please let me know - I really need this to work, and would be super grateful if you can guide me in the right direction.

Thank you so much. Hope to hear from you ASAP.
Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on May 19, 2014, 07:29:06 AM
I can't help with Lightroom or Zoner Studio, but read FAQ 26 (https://exiftool.org/faq.html#Q26) if you want to use ExifTool to write the information from your Excel sheet into your images.

- Phil
Title: Re: Import Excel - Photo Captions
Post by: Gerhart on May 24, 2014, 04:44:55 PM
Today I started to explore the possibilities of ExifTool for my photo business.
I have a similar issue with metadata to be written from an excel sheet.

In my case the excel sheet contains the filename the name of the client and some other data.
I want the client name to be written to the metadata as an keyword.

I work in windows 7 so this wouldn't work on a mac I think.

I started with making a function in excel vba.
Therefore you have to open excel and enter the vba editor
In the right column you right click to create a new function.
I came this far (I used dutch words for the string names):

Function ExifRenameString(Vnaam, TV, Anaam, Groep, Fotonr As String) As String
Dim ExifString, Naam As String
ExifString = "exiftool -keywords+="
If TV = "" Then Naam = Vnaam & " " & Anaam
If TV <> "" Then Naam = Vnaam & " " & TV & " " & Anaam
ExifRenameString = ExifString & Chr$(34) & Naam & Chr$(34) & " -overwrite_original " & Groep & "\" & Fotonr & ".jpg"
End Function

I used the Chr$(34) for " otherwise it wouldn't work.
I added the 'Groep' String because my photo's  are in subdirectories and this field contains the directory names.
- Vnaam contains the Firstname
- TV contains the Middlename
- Anaam contains the Lastname
- Fotonr contains the filename of the photo
You have to activate the function in Excel. (you'll find it under options or search google)

Now, if you open your worksheet.
In an empty column you insert the function (formula --> insert function)
Your new function should be visible in the user defined category.
- Select it and choose the columns you need
- DoubleClick the square on the right bottom corner to the formula copy to every row with data
- Right Click and copy the all the formula's
- Paste the data in a document from wich you can create a batch file (I use notepad on windows)
- Save the document as a batch file (put the name between " with the extention .bat)
- Run the .bat file in the directory with the photos (be sure ExifTool.exe is in the same directory)

There is one glitch. I have tried different characterset options but charaters like é, ü, í etc. are not written correctly to the metadata. So I'm still working on it.

I hope I could be of any help.
Can you share your solution if you find an other one?

Greetings Gerhard




Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on May 24, 2014, 04:50:22 PM
Thanks for the post Gerhard, but it should be a lot simpler than that.  All you need to do is export a spreadsheet from Excel in CSV format with the proper column headings then use -exiftool -csv=INPUT.csv DIR to write this information to your images.

And FAQ number 10 (https://exiftool.org/faq.html#Q10) may shed some light on your character encoding problems.

- Phil
Title: Re: Import Excel - Photo Captions
Post by: Gerhart on May 24, 2014, 05:41:34 PM
Thanks Phil,
Like I said, I'm new to Exiftool and am looking at it with the(old) knowledge I have.

Time to take a new approach.
Gerhard
Title: Re: Import Excel - Photo Captions
Post by: Gerhart on May 24, 2014, 05:50:39 PM
Btw,
Once you created the function in excel you can use it every time, so it will be less work.

I still wander how exiftool will know which keyword to write to witch file.
So I have some studying to do tomorrow.

I have looked at FAQ number 10 earlier today but I couldn't solve the problem yet.

Goodnight.

Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on May 24, 2014, 08:10:12 PM
Quote from: Gerhart on May 24, 2014, 05:50:39 PM
I still wander how exiftool will know which keyword to write to witch file.

The CSV file has the tag names as column headers, and the file names as row headers.  Read FAQ 26 as I mentioned earlier to see how this works.

- Phil
Title: Re: Import Excel - Photo Captions
Post by: Gerhart on June 01, 2014, 09:06:04 AM
Phil, today I found this tool.
http://www.photographers-toolbox.com/products/lrtransporter.php (http://www.photographers-toolbox.com/products/lrtransporter.php)

I tested it with lightroom 5.4 and it's easy to use and works good.
You have to donate to edit more then 5 records at once.
Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on June 01, 2014, 01:49:57 PM
Great.

I thought for a minute that you had found a metadata plug-in that didn't use ExifTool to do the heavy lifting.  I couldn't find any mention of ExifTool on the web site.  But I downloaded it to take a look, and sure enough, there is exiftool inside the plugin directory. :)

- Phil
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 20, 2014, 01:07:05 AM
Hi Phil,

I sure appreciate your Exiftool to possibly import my thousand of photo captions onto my images.... So, I have installed the exiftool cmd on Win8 and am using the line from your FAQ line 26, as mentioned in my earlier post (from May 2014).

However, the problem with importing my information - is exiftool does not like the first column - indicating it is not a Tag?

I have no idea what fields / column headings I should use -

# import from CSV file
exiftool -csv="c:\Users\Karen\photocaptionsGood-list.csv" "c:\Users\Karen\gallery"


** Can you please explain EXACTLY what my 4 column headings should be?

This is what I have so far:
00450004.JPG   Bow River looking towards downtown Calgary   00450004.JPG   2008-11-13 14:55

AND

** I have the photos separated into folders (i.e. gallery/alberta     gallery/europe/scotland   etc.)

Will the photo captions as indicated above - (without the sub folder) automatically write to the correct pictures, in the folder?

Please explain what I am doing wrong. I really need this to work asap.

Thank you so much. Looking forward to hearing from you. I have attached my photocaption.csv file for your review. Can you please kindly make any adjustments as needed to this file - so I can import all of my captions?

Thank you so much. Avid Professional Photographer here, and owner of web business in Canada....

Specifically, the first row of the CSV file must contain the tag names. The first column must be a special "SourceFile" column, containing the names of the associated image files, with paths specified in the same way as on the command line. The JSON file contains similar entries, but is not structured in row/column format.
For each image file specified on the command line, all tags for the database entry with the corresponding SourceFile name are written (with the exception of the FileName and Directory tags, which are ignored). A special SourceFile name of "*" may be used to match any image file. A warning is issued and nothing is written if a specified file does not match any SourceFile entry in the database.
Tag names may be prefixed by a group name to write to a specific group (using the same format as when -G or -G1 is added to the export command). Tags with empty values are ignored. To delete a tag, set the tag value to "-" and use the -f option when importing.
Title: Re: Import Excel - Photo Captions
Post by: Hayo Baan on June 20, 2014, 03:41:21 AM
Hi Webowner,

From the exiftool manual:
QuoteExport information in CSV format, or import information if CSVFILE is specified. When importing, the CSV file must be in exactly the same format as the exported file. The first row of the CSVFILE must be the ExifTool tag names (with optional group names) for each column of the file, and values must be separated by commas. A special ''SourceFile'' column specifies the files associated with each row of information (a SourceFile of ''*'' may be used to match any source file name).

So basically what's missing from your csv is telling ExifTool exactly what each column means. In your case all you should need to do is simply add a first line with the names of the tags the content should be put into:
SourceFile,Description,FileName,...
Note that there are a couple of things to take into account here:

Hope this helps...

Cheers,
Hayo
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 20, 2014, 01:32:54 PM
Hello,

Thank you for the help, however I am still confused.

What or How "exactly" do I identify fields / or rows in excel's csv file for "SourceFile" ?

If you can have a look, please at my csv file attached - can you make changes to it, and let me know?

I am having difficulty identifying each column - what exact format for headings or content do I need?

Thank you for the help. I really need this to work, but not at all sure what fields/headings / content it should be.

Can someone please take a look at my csv file attached, kindly please - and let me know ?
Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on June 20, 2014, 07:50:56 PM
Hi Karen,

Take a file that already contains the information you want, and run this command on it:

exiftool -s FILE  (where FILE is the name of the file)

The tag names will appear in the output.  These are what you need as the labels in the first row of your CSV file.  You need to figure out where you want the information to go (ie. what tag names to put in the first row).  I can't do this for you.

- Phil
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 20, 2014, 11:51:28 PM
Hi Phil,

I really appreciate your help, and many thanks for getting back to me.

I did exactly what you said - however it returned an Error

"Unknown File Type"

Strange I has it in .csv format as indicated.

So, I cannot display or produce any tags.... and therefore cannot import my photo captions.

Any other ideas? I really want to use your system and get this to work.

Thankyou.
Title: Re: Import Excel - Photo Captions
Post by: Phil Harvey on June 21, 2014, 06:21:55 AM
I wasn't specific enough.  FILE is the name of an image file containing the information.  This is essentially FAQ 2 (https://exiftool.org/faq.html#Q2).  Also, I suggest reading FAQ 26.

- Phil
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 21, 2014, 08:51:08 PM
Hi Phil,

I appreciate the help, but am way ahead of you. I have already reviewed the FAQ,s and still cant figure this out...

I think the best option now, is to manually add hundreds of photo captions into my Lightroom; as this way I can save the captions again.

Can you please review my .csv file and even, if possible try some exiftool commands at your end.... Obviously I know you dont have the images, but would it make any difference if the images are not contained with the the group or subgroup.... (i.e. in the .csv file - I have identified the image file as 104208234.jpg - and - did not indicate it was c:users\karen\gallery\europe\italy ) - Does that make any difference....

Hope you can continue to offer assistance, thank you so much. Unless I can get exiftool to work, I will revert to manually adding the captions.

Thank you so much.
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 22, 2014, 12:42:05 AM
Hi Phil,

Never Mind - Although I am sad :( to say I cannot get Exiftool to work - I am using another method, which works sooo well.

Have you heard of FotoTime... \ FotoAlbum 7
http://www.fototime.com/fotoalbum

With some slight adjustments to my .csv file - I can now successfully import Photo Captions, File data and Date the picture was taken. A lot of manual work is needed to ensure the File Name is a long sequence of numbers though, (PictureID) which I understand is similiar to your tags, and this is easily identified within the program itself...
{09B32595-6E72-4556-807E-7A25B25D7A2E}

But, good news - my captions are now being imported.

Sorry, I couldnt get exiftool to work - and am posting this \FotoAlbum\ for others who are also experiencing troubles. Although FotoTime7 is a paid program (which I paid) Import captions from Excel has never been easier.

Thank you.
Title: Re: Import Excel - Photo Captions
Post by: Hayo Baan on June 22, 2014, 04:54:41 AM
Hi Karen (?),

Sorry to read you could not get exiftool to work for you. In my earlier answer I basically gave you the answer you needed already. Your .csv just needed one line stating the tag names for each column. I only had trouble determining the exact date tag for you. But I think you want that to be DateTimeOriginal so the first line should have simply become:
SourceFile,Description,FileName,DateTimeOriginal

But as you have already gotten around to fixing the captions as you wanted, you do not need this any longer  ;)

Cheers,
Hayo
Title: Re: Import Excel - Photo Captions
Post by: webowner on June 22, 2014, 01:47:24 PM
Hello Hayo,

Thank you for the reply. I did have everything in my csv file as mentioned by you, and Phil - also by looking at the FAQ's.

Unfortunately, as mentioned ExifTool would not work for me....

After many attemps - but I am pleased to say all is resolved, I have found another method - which works very well, and couldn't be easier.

That is the usage of FotoTime's Foto Album PRO version 7 program.

Thank you again, and this post can be closed  :D

Best regards for all who use Exiftool.