Multiline tag values

Started by paulmapcreator, January 18, 2018, 04:29:42 AM

Previous topic - Next topic

paulmapcreator

Hi,

I'm having trouble adding multiline tagvalues to a pdf, the readme states that I should use '$' but that doesn't work (the $-sign isn't replaced internally into a newline).

For encoding reasons I use the -@ arglist option.
Have tried to surround the multiline value with "" but that didn't work either (files weren't updated due to errors).

Any solutions to this?

StarGeek

You might want to read FAQ 21.  It's not DollarSign $, it's DollarSignSlash $/ and you would use it in a redirection rather than assignment.  For example, in your arg file to set Description, you would use
-description<Line One$/Line Two

No quotes in an arg file unless you actually want quotes in the metadata.

Myself, I tend to use the -E option and insert the HTML entity. In an Arg file it would be:
-E
-description=Line One&#x0a;Line Two
* 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).

paulmapcreator

Both (through args file and as command line parameter) options result in the description being line1$/line2... (when using -t -s as parameters to view the tags).

Perhaps it's indeed better to html-encode it, but I'm not sure if those tags are being put in a system that's going to display it as html...

Phil Harvey

Both methods work for me (note that I'm on a Mac so I need to use single quotes around the '$', and also note that the newline shows up as a '.' in the -t -s output):

> exiftool a.jpg '-description<line1$/line2'
    1 image files updated
> exiftool a.jpg -description -t -s
Description line1.line2
> exiftool a.jpg -E "-description=Line One&#x0a;Line Two"
    1 image files updated
> exiftool a.jpg -description -t -s
Description Line One.Line Two


If you don't get the same results, try updating to the current version of ExifTool.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

paulmapcreator

Thanks, it's working now!

In the end, what I did wrong was using "=" instead of "<"

Phil Harvey

Ah yes.  That's been known to happen.  :P

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

paulmapcreator

Too bad that < isn't working for single line tags...

Phil Harvey

Quote from: paulmapcreator on February 06, 2018, 05:43:49 AM
Too bad that < isn't working for single line tags...

You'll have to be more specific.  I'm sure it works, but I suspect you are doing something wrong.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

paulmapcreator

The command I'm using is:
exiftool -config "exiftool_fotostation.config" test.pdf -@ exifparams.lst
if I have in the exifparams.lst
-description=multi line comment$/and this is the second one
or
-description<single line comment
then no description is present in the pdf.

For singleline I have to have
-description=single line comment
and for multiline I have to have
-description<multi line comment$/and this is the second one
to get a description in the pdf.

Exiftool version 10.6.1.0

Phil Harvey

Hi Paul,

QuoteFor singleline I have to have
-description=single line comment
and for multiline I have to have
-description<multi line comment$/and this is the second one
to get a description in the pdf.

OK, so you are using it correctly.  You need to use "=" if you aren't copying the value of a tag.  In this context, "$/" is a special tag with the value of a newline.  Using an HTML escape sequence is more efficient if this works for you:

-E
-description=single line comment
-description=multi line comment&#xa;and this is the second one


- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).