Nice to be in this community!
I can't append after using excelsheets to create excel, I can only cover;
If multiple sheets cannot be created using CSV;
I need to put the data of 2 devices into a file, each device corresponds to a piece of paper to record the data
[
{
"id": "81e91fe521078ee2",
"type": "tab",
"label": "临时测试",
"disabled": false,
"info": "",
"env": []
},
{
"id": "1502ffe3922a84f9",
"type": "inject",
"z": "81e91fe521078ee2",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 190,
"y": 120,
"wires": [
[
"6c5a46c348fb7688"
]
]
},
{
"id": "94e8f4497d62d569",
"type": "excelsheets",
"z": "81e91fe521078ee2",
"name": "",
"file": "C:\\Users\\User\\Desktop\\888.xlsx",
"x": 550,
"y": 120,
"wires": [
[]
]
},
{
"id": "6c5a46c348fb7688",
"type": "function",
"z": "81e91fe521078ee2",
"name": "",
"func": "msg.payload= [\n {\n header: {\n col1: \"记录时间\",\n col2: \"温度\",\n col3: \"湿度\"\n } ,\n items: [\n {\n col1: \"2022\",\n col2: \"115\",\n col3: \"252\",\n \n }\n ] ,\n sheetName: \"1号主机\"\n } ,\n {\n header: {\n col1: \"记录时间\",\n col2: \"温度\",\n col3: \"湿度\"\n } ,\n items: [\n {\n col1: \"2022\",\n col2: \"335\",\n col3: \"445\",\n }\n ] ,\n sheetName: \"2号主机\"\n } ,\n // {header, items, sheetName} ,\n // {header, items, sheetName} ,\n // {header, items, sheetName} \n];\n// filepath: \"C:\\Users\\User\\Desktop\\output.xlsx\";\nreturn msg;\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 120,
"wires": [
[
"94e8f4497d62d569"
]
]
},
{
"id": "a94276757e1214c2",
"type": "file",
"z": "81e91fe521078ee2",
"name": "csv test",
"filename": "C:\\Users\\User\\Desktop\\999.csv",
"appendNewline": true,
"createDir": true,
"overwriteFile": "false",
"encoding": "GB2312",
"x": 680,
"y": 280,
"wires": [
[
"9dc369d8e57ea079"
]
]
},
{
"id": "9dc369d8e57ea079",
"type": "debug",
"z": "81e91fe521078ee2",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 870,
"y": 280,
"wires": []
},
{
"id": "7164e33d28b33439",
"type": "function",
"z": "81e91fe521078ee2",
"name": "",
"func": "// msg.paylad={}\ndelete msg.payload\nmsg.payload=[{\n\"记录时间\":10,\n \"温度\":0,\n \"湿度\":30\n},{\n\"记录时间\":10,\n \"温度\":0,\n \"湿度\":300\n},\n]\n\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 350,
"y": 280,
"wires": [
[
"2e5aa088cb9c8927",
"43fa32cfd6566fa5"
]
]
},
{
"id": "3fda573d886f428f",
"type": "inject",
"z": "81e91fe521078ee2",
"name": "",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "true",
"payloadType": "bool",
"x": 190,
"y": 280,
"wires": [
[
"7164e33d28b33439"
]
]
},
{
"id": "2e5aa088cb9c8927",
"type": "debug",
"z": "81e91fe521078ee2",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 370,
"y": 220,
"wires": []
},
{
"id": "43fa32cfd6566fa5",
"type": "csv",
"z": "81e91fe521078ee2",
"name": "js转CSV",
"sep": ",",
"hdrin": true,
"hdrout": "once",
"multi": "one",
"ret": "\\r\\n",
"temp": "记录时间,温度,湿度",
"skip": "0",
"strings": true,
"include_empty_strings": "",
"include_null_values": "",
"x": 520,
"y": 280,
"wires": [
[
"a94276757e1214c2"
]
]
},
{
"id": "738ce264cc595661",
"type": "change",
"z": "81e91fe521078ee2",
"name": "",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 360,
"y": 420,
"wires": [
[]
]
}
]