I have a template.fmt like this;
# File
app__CreateDate: $CreateDate
app__FileName: $FileName
app__FileSize: $FileSize
# Image
app__Aperture: $Aperture
app__FocalLength: $FocalLength
app__FocalLength35mm: $FocalLengthIn35mmFormat
app__ISO: $ISO
app__ShutterSpeed: $ShutterSpeed
app__ImageWidth: $ImageWidth
app__ImageHeight: $ImageHeight
app__Device: $Make
app__Model: $Model
# App
app__FileType: $FileType
app__Title: $Title
app__Keywords: $Keywords
app__Description: $Description
It outputs a .yaml file with all the required parameters, which is used as a sidecard for my photo's.
The thing is, that the #-blocks (# FILE / # IMAGE / # APP) are rendered like FILE / IMAGE / APP -> the # sign is removed by the exif-tool;
File
app__CreateDate: 2019:10:01 09:36:45
app__FileName: IMG_20191001_093645.jpg
app__FileSize: 1818217
Image
app__Aperture: 1.75
app__FocalLength: 4.77
app__FocalLength35mm: 26
app__ISO: 116
app__ShutterSpeed: 0.008
app__ImageWidth: 3264
app__ImageHeight: 2448
app__Device: Xiaomi
app__Model: Mi 9 SE
App
app__FileType: 1
app__Title: {#TITLE#}
app__Keywords: {#KEYWORDS#}
app__Description: {#TEXT}
I need that # sign, because in .yaml it is something like a divider-sign.
Any idea how I can keep it?
I tried escaping like \# '# `# and ## but that ends up in \ ' `
Put #[BODY] in front of those lines
#[BODY]# File
app__CreateDate: $CreateDate
app__FileName: $FileName
app__FileSize: $FileSize
#[BODY]# Image
Quote from: StarGeek on December 05, 2021, 12:22:25 PM
Put #[BODY] in front of those lines
#[BODY]# File
app__CreateDate: $CreateDate
app__FileName: $FileName
app__FileSize: $FileSize
#[BODY]# Image
Interesting, that works perfectly.
#[BODY]# File becomes
# FILESo [body] and the 2nd # are removed, but the first one is still there.
Thanks for the answer!
@StarGeek: Very smart.
This could also be done by changing "#" to "$hash" and adding -userparam "hash=#" to the command.
But there was an inconsistency in the original post. The "#" lines should have been ignored, but yevev35775 stated that the "#" was removed and the rest of the line was output -- I don't see how this could happen.
- Phil
Quote from: yevev35775 on December 05, 2021, 01:11:25 PM
#[BODY]# File becomes # FILE
So [body] and the 2nd # are removed, but the first one is still there.
Technically, it's the first hashtag that's removed. You can test it by putting a space between
#[BODY] and the second hashtag. The output will have a leading space
Quote from: Phil Harvey on December 05, 2021, 06:21:59 PM
@StarGeek: Very smart.
This could also be done by changing "#" to "$hash" and adding -userparam "hash=#" to the command.
But there was an inconsistency in the original post. The "#" lines should have been ignored, but yevev35775 stated that the "#" was removed and the rest of the line was output -- I don't see how this could happen.
- Phil
Not sure what you are meaning, but my template is like this;
# HEADER-1
Foo: $foo
# HEADER-2
Bar: #barThis should output a sidecard for my photo's in the
.yaml (https://en.wikipedia.org/wiki/YAML) syntax, like this;
# HEADER-1
Foo: Hello
# HEADER-2
Bar: WorldBut since the # characters are deleted when parsing the template to the .yaml, it resulted in this;
HEADER-1
Foo: Hello
HEADER-2
Bar: WorldSo the # characters are gone, which I use for
markdown (https://en.wikipedia.org/wiki/Markdown) purposes (where # = H1, ## = H2, etc...).
But this works fine;
#[BODY]# HEADER-1
With the format file you posted:
# HEADER-1
Foo: $foo
# HEADER-2
Bar: #bar
You should get an output like this:
Foo: Hello
Bar: #bar
Which is not what you indicated.
- Phil
Quote from: Phil Harvey on December 06, 2021, 10:16:02 AM
With the format file you posted:
# HEADER-1
Foo: $foo
# HEADER-2
Bar: #bar
You should get an output like this:
Foo: Hello
Bar: #bar
Which is not what you indicated.
- Phil
You are correct, I made a mistake in my openings post.
Lines with a # are completely removed, since the tool thinks it's a comment.
But in my case it's not a comment, but a part of the markdown syntax.
I am glad you all helped me out.
Great. All is understood now.
- Phil