Node-Red导入execl表数据

Node-Red要导入一些数据,又不想使用数据库的方式,execl编辑好数据再导入到NR中,是一个好方法。围绕着NR,很多技术大牛开发了很有意思的节点,node-red-contrib-spreadsheet-in,是导入execl表的节点。
节点名:node-red-contrib-spreadsheet-in
引入之后的节点包括了:
image
首先说明,execl表分为三部分,文件名、表名、数据范围。


示例
该节点导入的时候会同时导入示例

据说“cell”节点很厉害,但我只是用于导入数据,所以cell没有用。直接上流吧,更直观

[{"id":"5de8aece.e9269","type":"inject","z":"d0e9d534.ff7a58","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":450,"y":80,"wires":[["cc63255a.dd75a8"]]},{"id":"cc63255a.dd75a8","type":"file in","z":"d0e9d534.ff7a58","name":"read a spreadsheet file as binary buffer","filename":"/data/test.xlsx","format":"","chunk":false,"sendError":false,"x":720,"y":80,"wires":[["d258d487.d3d6e8"]]},{"id":"d258d487.d3d6e8","type":"book","z":"d0e9d534.ff7a58","name":"","x":620,"y":140,"wires":[["9b94e80d.7fbbf8","6433a2f4.ac845c"]]},{"id":"6433a2f4.ac845c","type":"sheet","z":"d0e9d534.ff7a58","name":"","sheetName":"测试","x":620,"y":200,"wires":[["21c58530.3b8b5a","bcdc8bf2.984128","a18c9615.f90de8"]]},{"id":"21c58530.3b8b5a","type":"cell","z":"d0e9d534.ff7a58","name":"","address":"A1","dataType":"w","x":780,"y":260,"wires":[["939b3813.4e55d8"]]},{"id":"bcdc8bf2.984128","type":"sheet-to-json","z":"d0e9d534.ff7a58","name":"","raw":"false","range":"B3:D10","header":"1","blankrows":false,"x":800,"y":320,"wires":[["38dab6ef.5314ba"]]},{"id":"9b94e80d.7fbbf8","type":"debug","z":"d0e9d534.ff7a58","name":"","active":true,"console":"false","complete":"payload.SheetNames","x":950,"y":140,"wires":[]},{"id":"939b3813.4e55d8","type":"debug","z":"d0e9d534.ff7a58","name":"","active":true,"console":"false","complete":"false","x":1000,"y":260,"wires":[]},{"id":"38dab6ef.5314ba","type":"debug","z":"d0e9d534.ff7a58","name":"","active":true,"console":"false","complete":"false","x":1000,"y":320,"wires":[]},{"id":"a18c9615.f90de8","type":"debug","z":"d0e9d534.ff7a58","name":"","active":true,"console":"false","complete":"false","x":1000,"y":200,"wires":[]}]

1 个赞

请问可以保存到excel吗?