# Flow returns blank line between readings

**URL:** <https://discourse.nodered.org/t/flow-returns-blank-line-between-readings/61071>\
**Category:** General\
**Created:** [10 April 2022 15:28 UTC](https://discourse.nodered.org/t/flow-returns-blank-line-between-readings/61071 "2022-04-10T15:28:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![darius.curt](https://avatars.discourse-cdn.com/v4/letter/d/a698b9/32.png) [@darius.curt](https://discourse.nodered.org/u/darius.curt)\
**Post date:** [10 April 2022 15:28 UTC](https://discourse.nodered.org/t/flow-returns-blank-line-between-readings/61071/1 "2022-04-10T15:28:52Z")

</div>

Hello,  
I have a simple flow which receives the temperature readings of an Arduino in the form of T1=20.55. The Arduino is coded as such in order to print the value:  
Serial.println("T1=" + (String)temp1);

Now I have noticed that my flow prints in the debug console the following  
T1=20.55 followed by the enter character, which I understood it represents the new line from the Arduino command Serial.println.

After some tests trying to log the data in a csv file, I have noticed that my flow inserts a blank line between my readings, for example:  
20.55

21.00

20.55

I need help trying to figure out what can be done in order to get rid of those blank lines between the readings. Thank you!

---

<div class="post-metadata">

**Author:** ![E1cid](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/e1cid/32/77971_2.png) [@E1cid](https://discourse.nodered.org/u/E1cid)\
**Post date:** [10 April 2022 15:42 UTC](https://discourse.nodered.org/t/flow-returns-blank-line-between-readings/61071/2 "2022-04-10T15:42:23Z")

</div>

You will find a solution here

> [@Remove manuel line break from string for msg.payload and switch](https://discourse.nodered.org/t/remove-manuel-line-break-from-string-for-msg-payload-and-switch/60835/2):
>
> You can use a function node to trim the payload before the switch msg.payload = msg.payload.trim(); return msg; or use JSONata in the switch property $trim($$.payload)

Or  
you could change the output of the Arduino code to  
`Serial.println("{\"T1\": " + (String)temp1 + "}");` to output an json string.

---

<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:** [9 June 2022 15:42 UTC](https://discourse.nodered.org/t/flow-returns-blank-line-between-readings/61071/3 "2022-06-09T15:42:24Z")

</div>

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