# CSV node, write output node is not working

**URL:** <https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253>\
**Category:** General\
**Created:** [9 August 2022 21:17 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253 "2022-08-09T21:17:00Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeetaJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/neetaj/32/60934_2.png) [@NeetaJ](https://discourse.nodered.org/u/NeetaJ)\
**Post date:** [9 August 2022 21:17 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/1 "2022-08-09T21:17:00Z")

</div>

Hello,

I have a flow where i am passing payload to csv node and then to write file.  
I have also mentioned absolute path of that file. But it is not updated. I do get the output with values but nothing is written in the csv file, Its empty

```auto
[{"id":"687af5224965c5bc","type":"function","z":"b0a0f7654864d522","name":"","func":"msg.payload=\n { \n \"SalesOrderNumber\": msg.SalesOrderNumber, \n \"ContractNumber\": msg.ContractNumber, \n \"SoldToCustomerNumber\": msg.SoldToCustomerNumber \n }\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":1580,"wires":[["dd66c90fb1c4dc10"]]},{"id":"dd66c90fb1c4dc10","type":"csv","z":"b0a0f7654864d522","name":"","sep":",","hdrin":"","hdrout":"all","multi":"one","ret":"\\n","temp":"SalesOrderNumber,ContractNumber,SoldToCustomerNumber","skip":"0","strings":true,"include_empty_strings":"","include_null_values":"","x":510,"y":1580,"wires":[["8d8bd481eecd4656","59b56d05ebdcd5bd"]]},{"id":"8d8bd481eecd4656","type":"file","z":"b0a0f7654864d522","name":"Excel_Out","filename":"C:\\Users\\neeta.jadhav\\Documents\\Details.csv","appendNewline":true,"createDir":false,"overwriteFile":"true","encoding":"base64","x":670,"y":1580,"wires":[["439de8c26e64cb51"]]}]

```

 ![Capture](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/f/8f8abbdb2cb5ccbe0e84eab9ce3eb9b30e9a18e0.png)

Kindly let me know if i am missing something

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [9 August 2022 21:45 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/2 "2022-08-09T21:45:57Z")

</div>

I'm not suggesting that answering these questions will resolve your empty file problem, but it might help my understanding of it!

Why have you specified base64 encoding?  
Do you really want to overwrite the file each time a new message arrives, as opposed to appending a new line of data?

---

<div class="post-metadata">

**Author:** ![NeetaJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/neetaj/32/60934_2.png) [@NeetaJ](https://discourse.nodered.org/u/NeetaJ)\
**Post date:** [10 August 2022 10:06 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/3 "2022-08-10T10:06:59Z")

</div>

Hi @jbudd,

It was just the trial and error i was performing. For me the goal is to have the file on my system with those data.

And I want to append the data to file, For this I need to change the setting of write file node

Thanks,  
Neeta

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 August 2022 10:41 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/4 "2022-08-10T10:41:48Z")

</div>

My Node-red is on Linux not Windows so of course I do not have a `C:\\Users\\neeta.jadhav\\Documents\\Details.csv`

Edit - though I do (now) have a /home/pi/ 'C:\Users\neeta.jadhav\Documents\Details.csv' file!

I can only suggest you make sure that the path to your Documents folder is correct, and try using `/` instead of `\\` in the Write file node:  
`C:/Users/neeta.jadhav/Documents/Details.csv`

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 August 2022 10:52 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/5 "2022-08-10T10:52:34Z")

</div>

One issue may be your `file-out` node where you have set 'overwrite file` which means each time a msg si sent to the node, the file will be overwritten so you will only ever have one line in it.

---

<div class="post-metadata">

**Author:** ![NeetaJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/neetaj/32/60934_2.png) [@NeetaJ](https://discourse.nodered.org/u/NeetaJ)\
**Post date:** [10 August 2022 10:54 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/6 "2022-08-10T10:54:33Z")

</div>

Hi @zenofmud : Yeah one line is also fine. Problem is its not at all writing to the file.

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 August 2022 10:59 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/7 "2022-08-10T10:59:40Z")

</div>

Does the directory exist?

Also, when asking for help, it woould be useful to create and inject node with some of the data to be processed so the person you want to help you doesn't have to do that to help you....

EDIT: works fine for me on my mac

 ![Screen Shot 2022-08-10 at 7.04.20 AM](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/e/ae0c46fda2e88021a20b409a45e381ebef20b534.png)

---

<div class="post-metadata">

**Author:** ![NeetaJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/neetaj/32/60934_2.png) [@NeetaJ](https://discourse.nodered.org/u/NeetaJ)\
**Post date:** [10 August 2022 11:28 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/8 "2022-08-10T11:28:32Z")

</div>

Yes, That's true. I would provide you the inject and debug node from next time. Apologies for inconvenience.

Actually I just realized that Node-Red installed on Linux machine and based on some sort of setup like Rancher I can use that instance on my windows machine.

So now I have created a csv file on Linux machine

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

Also i have checked on the permissions

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

But still my Node red throws this error.  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/2/e23232ea4560399be9a8371694a320cb7f24c27b.png)

Absolute path of the file in the node setting  
 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/c/2/c2d45388fcf31ed7c109cb2389ddec58778a0470.png)

Thanks,  
Neeta

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 August 2022 11:42 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/9 "2022-08-10T11:42:45Z")

</div>

If Node-RED is installed on a Linux aching, and your windows maching is on the same network you should be able to access Node-RED by using `http://ip-of-node-red-device:1880`

As to how all of this will work with Rancher I have no idea since this is the first I have ever heard about it.

---

<div class="post-metadata">

**Author:** ![jbudd](https://avatars.discourse-cdn.com/v4/letter/j/5f8ce5/32.png) [@jbudd](https://discourse.nodered.org/u/jbudd)\
**Post date:** [10 August 2022 11:50 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/10 "2022-08-10T11:50:12Z")

</div>

I am not familiar with Rancher either but the path /home/admin-njadhav@eu.didata.local/Details.csv doesn't look right.

I would expect the bit identifying the machine (@eu.didata.local ?) to come before the path (/home/admin-njadhav/Details.csv). I may be wrong!

---

<div class="post-metadata">

**Author:** ![NeetaJ](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/neetaj/32/60934_2.png) [@NeetaJ](https://discourse.nodered.org/u/NeetaJ)\
**Post date:** [11 August 2022 14:13 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/11 "2022-08-11T14:13:58Z")

</div>

Thanks i was able to resolve the issue

---

<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:** [25 August 2022 14:14 UTC](https://discourse.nodered.org/t/csv-node-write-output-node-is-not-working/66253/12 "2022-08-25T14:14:34Z")

</div>

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