# How to add the individual serial output into CSV. file

**URL:** <https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203>\
**Category:** General\
**Tags:** database\
**Created:** [25 January 2022 12:05 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203 "2022-01-25T12:05:29Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![51fei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/51fei/32/54820_2.png) [@51fei](https://discourse.nodered.org/u/51fei)\
**Post date:** [25 January 2022 12:05 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/1 "2022-01-25T12:05:29Z")

</div>

My project had serval sensors like humidity, temperature, and EC value. I want to store all the data one column by one column in an Excel sheet. I had followed this tutorial: [Auto Logger: log data in daily CSV files (flow) - Node-RED](https://flows.nodered.org/flow/4f0653905120f422cc4f37cd5512ee14).

 ![Screenshot 2022-01-25 at 7.59.46 PM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/8/38c0228c7ac15d860c9fc9cf15e286a836ca619e.png)

I want to know if I used serial out, how to do it?

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 January 2022 13:47 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/2 "2022-01-25T13:47:30Z")

</div>

> [@51fei](#):
>
> I want to know if I used serial out, how to do it?

Are you trying to save data from a serial _input_ in excel, or that you want to send data to a serial _output_ from the csv file?

---

<div class="post-metadata">

**Author:** ![51fei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/51fei/32/54820_2.png) [@51fei](https://discourse.nodered.org/u/51fei)\
**Post date:** [25 January 2022 16:29 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/3 "2022-01-25T16:29:23Z")

</div>

I want to save data from a serial _input_ in excel.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 January 2022 16:41 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/4 "2022-01-25T16:41:22Z")

</div>

Solve the problem one piece at a time.

Start by using the serial node to get the data. Once you have that going then move on to how to save it in the csv file.

---

<div class="post-metadata">

**Author:** ![51fei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/51fei/32/54820_2.png) [@51fei](https://discourse.nodered.org/u/51fei)\
**Post date:** [25 January 2022 16:53 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/5 "2022-01-25T16:53:10Z")

</div>

I can use the Serial node to get the data. How to write in function? Most of the examples I saw are saving data one sheet by sheet.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [25 January 2022 17:14 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/6 "2022-01-25T17:14:46Z")

</div>

> [@51fei](#):
>
> Most of the examples I saw are saving data one sheet by sheet.

Sorry, I don't understand what you mean by that. What is a sheet in this context?  
If you use a File Write node to write to the csv file you can tell it to append to the current file so you can add one line at a time.

---

<div class="post-metadata">

**Author:** ![51fei](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/51fei/32/54820_2.png) [@51fei](https://discourse.nodered.org/u/51fei)\
**Post date:** [26 January 2022 01:25 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/7 "2022-01-26T01:25:26Z")

</div>

I can add lines, but I want to add multiple columns of different sensors.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [26 January 2022 21:57 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/8 "2022-01-26T21:57:44Z")

</div>

I am not sure exactly what you mean. Is it that the sensor values are arriving in separate messages and actually what you are asking is how to join messages from different sources into one message so you can add data for all the sensors in one record? If so then see [this article in the cookbook](https://cookbook.nodered.org/basic/join-streams) for an example of how to join messages into one object.

Import it, look at the help text for the Join node and make sure you understand how the flow works. Then you should be able to use it for what you want.

---

<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:** [27 March 2022 21:58 UTC](https://discourse.nodered.org/t/how-to-add-the-individual-serial-output-into-csv-file/57203/9 "2022-03-27T21:58:16Z")

</div>

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