# Appending Special Characters to flow

**URL:** <https://discourse.nodered.org/t/appending-special-characters-to-flow/28112>\
**Category:** General\
**Created:** [10 June 2020 13:24 UTC](https://discourse.nodered.org/t/appending-special-characters-to-flow/28112 "2020-06-10T13:24:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aidan](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@aidan](https://discourse.nodered.org/u/aidan)\
**Post date:** [10 June 2020 13:24 UTC](https://discourse.nodered.org/t/appending-special-characters-to-flow/28112/1 "2020-06-10T13:24:13Z")

</div>

I have to sum two streams of ASCII data, 'STX'-'ASCII message'-'ETX' one of them has redundant data so I need to 'parse and pass' Should be easy, first two characters of 'ASCII message' are always 'M0' length is fixed, so i can manage to pull out wanted data all I then need is to prepend STX and append ETX Have spent about two hours trying below is my flow. Help appreciated.

 ![Example](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/3/e3cf7a86541fe5fd8901128bf64a4e1f22202aa9.png)

---

<div class="post-metadata">

**Author:** ![edje11](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/edje11/32/572_2.png) [@edje11](https://discourse.nodered.org/u/edje11)\
**Post date:** [10 June 2020 13:37 UTC](https://discourse.nodered.org/t/appending-special-characters-to-flow/28112/2 "2020-06-10T13:37:23Z")

</div>

Think there are various ways to do that, this is one of them.  
Put it in a function node.

```auto
msg.payload = String.fromCharCode(0x02) + msg.payload + String.fromCharCode(0x03) + "\n\r"
return msg;

```

---

<div class="post-metadata">

**Author:** ![aidan](https://avatars.discourse-cdn.com/v4/letter/a/c5a1d2/32.png) [@aidan](https://discourse.nodered.org/u/aidan)\
**Post date:** [10 June 2020 13:43 UTC](https://discourse.nodered.org/t/appending-special-characters-to-flow/28112/3 "2020-06-10T13:43:17Z")

</div>

Thanks good solution - works just fine

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [24 June 2020 13:43 UTC](https://discourse.nodered.org/t/appending-special-characters-to-flow/28112/4 "2020-06-24T13:43:18Z")

</div>

Closed on 24 June 2020 13:43 UTC

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
