CSV node, write output node is not working


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

[{"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"]]}]

Kindly let me know if i am missing something

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?

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


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:

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.

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

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

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

Also i have checked on the permissions

But still my Node red throws this error.

Absolute path of the file in the node setting


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.

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!

Thanks i was able to resolve the issue

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