# Remove Linefeed (/n) in CSV Node

**URL:** <https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612>\
**Category:** General\
**Created:** [23 December 2021 12:58 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612 "2021-12-23T12:58:00Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hyxion14](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@Hyxion14](https://discourse.nodered.org/u/Hyxion14)\
**Post date:** [23 December 2021 12:58 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/1 "2021-12-23T12:58:00Z")

</div>

Hi, I have created a flow that extracts information from an http API, with that information I create a payload and I want to write the payload in a CSV.

The flow works correctly, but in the CSV it inserts a blank line between each line created in the CSV.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/c/8c9f4e18bec6f10e41fe87c07898da8cc1640084.png)

How can I configure the CSV so that it does not create this line break?

Thank you very much and Merry Christmas to all.

---

<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:** [23 December 2021 13:36 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/2 "2021-12-23T13:36:00Z")

</div>

Show us what the message going into the CSV node looks like in a debug node.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [23 December 2021 14:01 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/3 "2021-12-23T14:01:11Z")

</div>

how are you then saving the CSV ? If using a file out node you don't need to an a new line to each line as the csv has already done that for you.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/b/6b4f98031068199aa73c46e3d5aa7bee73d2f964.png)  
Make sure the file out node dies not have this ticked...

---

<div class="post-metadata">

**Author:** ![Hyxion14](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@Hyxion14](https://discourse.nodered.org/u/Hyxion14)\
**Post date:** [23 December 2021 21:01 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/4 "2021-12-23T21:01:09Z")

</div>

Hello Colin, this is the debug of csv node:

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/6/06bad105eb27b029ce58cbcfc913802fb2b18533.png)

---

<div class="post-metadata">

**Author:** ![Hyxion14](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@Hyxion14](https://discourse.nodered.org/u/Hyxion14)\
**Post date:** [23 December 2021 21:05 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/5 "2021-12-23T21:05:26Z")

</div>

Indeed I use a file node to save the csv, but I don't know how to remove the new line in the csv node.

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/7/37cd2d2d9ee06ce67a5949c86a95bb8ecb82a8a9.png)

This is the configuration I have in the csv node:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/3/1/3196f8f10b6e70ff711b9468bfae7e4aaa4a1451.png)

---

<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:** [23 December 2021 21:22 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/6 "2021-12-23T21:22:27Z")

</div>

As @dceejay said, in the File node make sure you have not ticked `Add newline to each payload`. The strings you are writing already include new lines so you don't want another.

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [24 December 2021 01:56 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/7 "2021-12-24T01:56:08Z")

</div>

If Colin's suggestion does not resolve the issue, you might try changing your `csv` node config to use Unix style newlines `\n` (currently you are using Windows style newlines `\r\n`) -- those two characters at the end of each line could be causing the extra blank lines.

---

<div class="post-metadata">

**Author:** ![Hyxion14](https://avatars.discourse-cdn.com/v4/letter/h/977dab/32.png) [@Hyxion14](https://discourse.nodered.org/u/Hyxion14)\
**Post date:** [8 January 2022 19:58 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/8 "2022-01-08T19:58:45Z")

</div>

Hello,

it seems I needed some vacation days to see what I had in front of me, indeed @dceejay is right, I had the option "Add newline to each payload" in the File node activated, I'm sorry I didn't see it before.

Thanks @dceejay , @Colin and @shrickus

Happy New Year 2022.

---

<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:** [22 January 2022 19:59 UTC](https://discourse.nodered.org/t/remove-linefeed-n-in-csv-node/55612/9 "2022-01-22T19:59:28Z")

</div>

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