# Control character for comment edits

**URL:** <https://community.metabrainz.org/t/control-character-for-comment-edits/596250>\
**Category:** MusicBrainz Picard\
**Created:** [August 7, 2022, 4:22pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250 "2022-08-07T16:22:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecomaniac](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ecomaniac/32/57169_2.png) [@ecomaniac](https://community.metabrainz.org/u/ecomaniac)\
**Post date:** [August 7, 2022, 4:22pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/1 "2022-08-07T16:22:24Z")

</div>

I’ve started adding %\_releaseannotation% to comments. I’d like to append the existing comment to the release annotation with a carriage return in between. The UTF-8 carriage return character is “u000D”, so I tried:

$set(\_commenttemp,%comment%)  
$set(comment,%\_releaseannotation%\u000D%\_commenttemp%)

Unfortunately, the control character just converts to text (sorta), so it’s not working. Suggestions?

---

<div class="post-metadata">

**Author:** ![UltimateRiff](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ultimateriff/32/47799_2.png) [@UltimateRiff](https://community.metabrainz.org/u/UltimateRiff)\
**Post date:** [August 7, 2022, 5:07pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/2 "2022-08-07T17:07:10Z")

</div>

I take it you’ve already tried putting a regular non-encoded carriage return in the script, for example:

```auto
$set(_commenttemp,%comment%)
$set(comment,%_releaseannotation%
%_commenttemp%)

```

_I will admit, I’m not familiar with inserting characters like this, btw…_

---

<div class="post-metadata">

**Author:** ![elomatreb](https://community.metabrainz.org/user_avatar/community.metabrainz.org/elomatreb/32/44009_2.png) [@elomatreb](https://community.metabrainz.org/u/elomatreb)\
**Post date:** [August 7, 2022, 6:11pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/3 "2022-08-07T18:11:24Z")

</div>

I wonder why you specifically want a _carriage return_ there, as that either is invisible and the text is simple visually appended or it results in the text being overwritten by the second part on terminals.

---

<div class="post-metadata">

**Author:** ![ecomaniac](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ecomaniac/32/57169_2.png) [@ecomaniac](https://community.metabrainz.org/u/ecomaniac)\
**Post date:** [August 7, 2022, 7:54pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/4 "2022-08-07T19:54:06Z")

</div>

@UltimateRiff That works! Who woulda thunk…

@elomatreb . I don’t understand about it being overwritten as I assumed it would include a line feed which is the case in UltimateRiff’s example. I’ve now included a conditional so that the edit is only applied if an annotation exists.

Thanks for the help!

---

<div class="post-metadata">

**Author:** ![elomatreb](https://community.metabrainz.org/user_avatar/community.metabrainz.org/elomatreb/32/44009_2.png) [@elomatreb](https://community.metabrainz.org/u/elomatreb)\
**Post date:** [August 7, 2022, 7:56pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/5 "2022-08-07T19:56:25Z")

</div>

A carriage return moves the cursor back to the beginning of the current line, you’re thinking of the newline character (U+000A), that you get when you press enter.

Windows ends lines in text files with both the newline and the carriage return character, but this is a historic weirdness that serves basically no purpose anymore.

---

<div class="post-metadata">

**Author:** ![ecomaniac](https://community.metabrainz.org/user_avatar/community.metabrainz.org/ecomaniac/32/57169_2.png) [@ecomaniac](https://community.metabrainz.org/u/ecomaniac)\
**Post date:** [August 7, 2022, 8:08pm UTC](https://community.metabrainz.org/t/control-character-for-comment-edits/596250/6 "2022-08-07T20:08:44Z")

</div>

I had trieed u+000A first, then switched to the carriage return when it didn’t work. Yeah, too bad that’s not the only historic weirdness! lol
