I need to use the double quote in my image description and I've forgotten how

Started by Kaelkitty, September 15, 2018, 11:57:44 PM

Previous topic - Next topic

Kaelkitty

Hi,
I have been using the command format you gave me back in April with great success, until today. I tried this:

exiftool -imagedescription="JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves" "C:\Users\Dell\Desktop\2013 PHOTOS\2013-09-15\100_1286.JPG"

which produced (not entirely surprisingly):

Error: File not found - green
Error: File not found - leaves"
Error: File not found - C:/Users/Dell/Desktop/2013 PHOTOS/2013-09-15/100_1286.JPG


What do I use to substitute for the inner quotes in "pistachio green leaves" so that they appear correctly in the output?  I can't use single quotes here because they have a specific meaning in botanical names.  I have tried double and triple sets of the " character without success.

Thanks, KK.

StarGeek

Here are a few ways.  I use my own shortcut tag idesc instead of ImageDescription because long ago I got too lazy to keep typing the whole thing out :D.

Using CMD:
You can use three double quotes when you want to embed a double quote.  You can also escape it with a back slash.  See the first two examples below.  The problem with these is the more complex the command, the more likely Windows is just going to choke on it and give you something unexpected.  I think you can get 3 or 4 through ok, but more than that, in my experience, the more likely something doesn't get interpreted by CMD properly.

Example 3 uses the html entity " and the -E option.

Example 4 is to write it to a temp file and then embed it from there.  There are two dots following that one because echo appends a CRLF.  If you create a temp file without it then it wouldn't have the trailing CRLF.

Examples:
C:\>exiftool -P -overwrite_original -idesc="JFS2010/10/16 Kalanchoe rotundifolia? """pistachio green leaves"""" y:\!temp\Test4.jpg 
    1 image files updated

C:\>exiftool -g1 -a -s -idesc y:\!temp\Test4.jpg
---- IFD0 ----
ImageDescription                : JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves"

C:\>exiftool -P -overwrite_original -idesc="JFS2010/10/16 Kalanchoe rotundifolia? \"pistachio green leaves\"" y:\!temp\Test4.jpg 
    1 image files updated

C:\>exiftool -g1 -a -s -idesc y:\!temp\Test4.jpg
---- IFD0 ----
ImageDescription                : JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves"

C:\>exiftool -P -overwrite_original -E -idesc="JFS2010/10/16 Kalanchoe rotundifolia? &#quot;pistachio green leaves&#quot;" y:\!temp\Test4.jpg 
    1 image files updated

C:\>exiftool -g1 -a -s -idesc y:\!temp\Test4.jpg
---- IFD0 ----
ImageDescription                : JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves"

C:\>echo >temp.txt JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves"

C:\>exiftool -P -overwrite_original "-idesc<=temp.txt" y:\!temp\Test4.jpg 
    1 image files updated

C:\>exiftool -g1 -a -s -idesc y:\!temp\Test4.jpg
---- IFD0 ----
ImageDescription                :  JFS2010/10/16 Kalanchoe rotundifolia? "pistachio green leaves"..
"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

Kaelkitty

 :-[  I can see exactly what I was doing wrong, now.  I was forgetting the extra double quote to close the text for the item description!  (three in front, FOUR at the end!)

Thanks for the speedy resolution, 
KK.