Excel: how to write in desired cell

Hi,
should I write this message in cell "C3",
how can this be done with the node "file"?

[{"id":"2735b2c2.710b4e","type":"file","z":"9c807128.5de97","name":"","filename":"c:\\a\\12345.xls","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":680,"y":960,"wires":[[]]},{"id":"f918bd06.19058","type":"function","z":"9c807128.5de97","name":"Write Excell","func":"var a = msg.payload[\"50\"];\nvar b = msg.payload[\"51\"];\nvar d = new Date();\n\n\nnode.send({\n      payload:  \n      \"xxxx;\"+\"\\n\"+  \"UTF01: \"+a+\"\\n\"    +\"UTF02: \"+b, \n   });\n\nreturn;","outputs":1,"noerr":0,"x":490,"y":960,"wires":[["2735b2c2.710b4e"]]},{"id":"fcc18df8.a50db","type":"inject","z":"9c807128.5de97","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":960,"wires":[["f918bd06.19058"]]}]

Thanks

Hi rromele, it would be good if you include a bit more info in your post.

I did have a look at your flow and see that you are trying to write to a cell in an xls file.

Unfortunately, I'm fairly certain you cant simply update an XLS file by appending a string to the file.

The BIFF format employed by XLS files is very complex!

There are libraries in github for working with excel (mostly XLSX files) but i dont think there are any node-red nodes that will work with editing the contents of an existing excel workbook/worksheet.

hi,
you are right I reformulate the question in a simpler way:
I need to write a number in column "C" in a xls or csv file;
by default the node "file" writes in column "A".
I asked if there was the ability to write code to parameterize this node (or if there is a similar node to do this).

[{"id":"3e6a6fa.34ea89","type":"function","z":"9c807128.5de97","name":"","func":"var num = msg.payload;\n\nreturn msg;","outputs":1,"noerr":0,"x":370,"y":1240,"wires":[["f14e6e79.0dbe6"]]},{"id":"ced72845.23c588","type":"inject","z":"9c807128.5de97","name":"","topic":"","payload":"50","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":230,"y":1240,"wires":[["3e6a6fa.34ea89"]]},{"id":"f14e6e79.0dbe6","type":"file","z":"9c807128.5de97","name":"","filename":"c:\\a\\AAA.xls","appendNewline":true,"createDir":true,"overwriteFile":"false","encoding":"none","x":550,"y":1240,"wires":[[]]}]

plenty of CSV nodes / flows / examples in the library

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