Newline using codes not translated reading from argument file

Started by CanyonJim, September 16, 2016, 10:17:06 PM

Previous topic - Next topic

CanyonJim

Running ExifTool 10.2.5 on Windows 10 via my own C# program.

My C# program creates an argument file to update various metadata fields.  It works fine except for descriptions with newline characters.  I translate newlines ("\n") to "
" before writing the description to the arguments file and set the -E option in the run command arguments, but the "
" ends up in the description instead of a newline.  (I tried writing the newline instead, but predictably ExifTool complains about a bad file name.)

The parameter to the Run command are:

-@ "{ArgumentsPath}" -common_args -echo2 -E -sep "; " -overwrite_original

where {ArgumentsPath} is the full pathname of a temporary file and the double quotes are properly escaped in the code.

An example of an arguments file is:

-EXIF:ImageDescription=A Hansen family portrait: Walter Laurits Hansen, Chris Gerald Hansen, Edward Soerd Hansen, Edith Marie Hansen, and Raymond Walter Hansen.
Based on comparisons with two other photos dated May 29,1926 and Aug., 1927 this would appear to have been made in 1926.
-XMP-dc:description-x-default=A Hansen family portrait: Walter Laurits Hansen, Chris Gerald Hansen, Edward Soerd Hansen, Edith Marie Hansen, and Raymond Walter Hansen.
Based on comparisons with two other photos dated May 29,1926 and Aug., 1927 this would appear to have been made in 1926.
-IPTC:Caption-Abstract=A Hansen family portrait: Walter Laurits Hansen, Chris Gerald Hansen, Edward Soerd Hansen, Edith Marie Hansen, and Raymond Walter Hansen.
Based on comparisons with two other photos dated May 29,1926 and Aug., 1927 this would appear to have been made in 1926.
D:\Photos\Family archive\Hansen Glencoe 1924-27\PSD\Hansen Glencoe 1924-27 04f.psd
-execute

(re line-wrapping in the post: There are five lines in the file and every line except the file name begins with a minus sign.)

Am I missing something?

...Jim Hansen

Phil Harvey

Hi Jim,

The problem is that -echo2 takes an argument (the string to echo).  Here you are echoing "-E" instead of applying the -E option.

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

CanyonJim

Oops!  I misunderstood -echo2.  It works fine now.

Thanks for your help.

...Jim