Problems with creating CSV or excel

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

Please use the below guide to post code in preformatted text, so that it is easy to copy your code.

howtopastecode

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

hi smanjunath211
Can this be reproduced now? I am a novice
thanks

Welcome to the forum.

It helps to provide a reference to specific nodes you might be using. In this case: node-red-contrib-excelsheets (node) - Node-RED (nodered.org). (There are thousands of nodes now at it is often hard to know what people are using).

So can you confirm that you've successfully read the input workbook and you are getting the expected data payload?

Then perhaps you can explain what you are trying to add/change? And what is actually happening. As we don't have your original workbooks, it is hard to work out what is happening.

And I am sorry, I think Google translate is not at its best here, please confirm if I am reading your problem right.
You are able to create an excel file (I did using your flow), but you don't know how to append your file with new data. That is add new data at the end of file. I could not understand about CSV though. Are you saying you cannot have two worksheets in CSV, I think you are right. As far as I know CSV cannot have multiple worksheets.

hi smanjunat.
Thank you for your reply, your understanding is correct, the current excel is unable to add data
I need to append data in excel, and when I reinject the data before excel is overwritten

Think you reply. When I reinject the data before excel is overwritten

I did a little research and found this answer by @TotallyInformation who is also seeing this thread. may be he has some more inputs. sorry I could not help.

Unfortunately, this is a different node as far as I can tell from what has been shared.

The node doesn't have a lot of documentation so I think an issue will need to be raised in GitHub to find an answer. Or maybe use the excel node instead?

Can excel node create two sheets? He wants two separate worksheets to be updated for two inputs.

There are a few node-red nodes for excel on the flows library (and there are even more if you use a regular npm module in a function node (how to)).

Here are the current node-red nodes listed in the library (as of writing)...

excel nodes on flows library

I have tried several ways but failed, can you help me
thanks

[
    {
        "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": 150,
        "y": 40,
        "wires": [
            [
                "6c5a46c348fb7688"
            ]
        ]
    },
    {
        "id": "94e8f4497d62d569",
        "type": "excelsheets",
        "z": "81e91fe521078ee2",
        "name": "",
        "file": "C:\\Users\\User\\Desktop\\888.xlsx",
        "x": 550,
        "y": 40,
        "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: \"999\",\n            }\n        ] ,\n        sheetName: \"2号主机\"\n    } ,\n    // {header, items, sheetName} ,\n    // {header, items, sheetName} ,\n    // {header, items, sheetName} \n];\nfilepath: \"C:\\Users\\User\\Desktop\\output.xlsx\";\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 40,
        "wires": [
            [
                "94e8f4497d62d569"
            ]
        ]
    },
    {
        "id": "c9ed56984190b95d",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "When I repeat the injection, the previous data in execl is overwritten",
        "info": "",
        "x": 720,
        "y": 80,
        "wires": []
    },
    {
        "id": "b1a9abafe7a0dd64",
        "type": "excel",
        "z": "81e91fe521078ee2",
        "name": "excel",
        "file": "C:\\Users\\User\\Desktop\\666.xlsx",
        "x": 550,
        "y": 280,
        "wires": [
            []
        ]
    },
    {
        "id": "1a430109f61e57aa",
        "type": "xlsx-out",
        "z": "81e91fe521078ee2",
        "name": "xlsx-out",
        "sheetName": "test",
        "x": 740,
        "y": 540,
        "wires": [
            [
                "4b65ddf15b516640",
                "506e93ae9b6d2e57"
            ]
        ]
    },
    {
        "id": "876da1bea0183b7d",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 170,
        "y": 280,
        "wires": [
            [
                "f633ab87b184dec6"
            ]
        ]
    },
    {
        "id": "f0426b0398f4445f",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 570,
        "y": 240,
        "wires": []
    },
    {
        "id": "f633ab87b184dec6",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "",
        "func": "msg.payload= [\n    {\n        a:1,\n        b:2,\n    },\n    //     {\n    //     c:11,\n    //     d:22,\n    // },\n    ];\n\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 370,
        "y": 280,
        "wires": [
            [
                "f0426b0398f4445f",
                "b1a9abafe7a0dd64"
            ]
        ]
    },
    {
        "id": "578a2d608e348863",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "When I repeat the injection, the previous data is overwritten and 2 sheets cannot be created",
        "info": "",
        "x": 810,
        "y": 320,
        "wires": []
    },
    {
        "id": "29e5774f88867339",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "chiller01",
        "func": "msg.sheetName=\"chiller01\"\nmsg.payload=[\n   {\n            col1: \"记录时间\",\n            col2: \"温度\",\n            col3: \"湿度\"\n        } ,\n            {\n            col1: \"2022\",\n            col2: \"115\",\n            col3: \"252\",\n            }\n        ] \nmsg.fileName=\"C:\\Users\\User\\Desktop\\999.xlsx\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 540,
        "wires": [
            [
                "417ac20ebe3f2a86"
            ]
        ]
    },
    {
        "id": "cd42f86717242e4d",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 150,
        "y": 540,
        "wires": [
            [
                "29e5774f88867339"
            ]
        ]
    },
    {
        "id": "5b6c585b086827d7",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "chiller02",
        "func": "msg.sheetName=\"chiller02\"\nmsg.payload= [5,6,7,8];\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 340,
        "y": 620,
        "wires": [
            [
                "417ac20ebe3f2a86"
            ]
        ]
    },
    {
        "id": "bf18c1beecb0f4d0",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 150,
        "y": 620,
        "wires": [
            [
                "5b6c585b086827d7"
            ]
        ]
    },
    {
        "id": "4b65ddf15b516640",
        "type": "file",
        "z": "81e91fe521078ee2",
        "name": "write file",
        "filename": "C:\\Users\\User\\Desktop\\999.xlsx",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "false",
        "encoding": "GB2312",
        "x": 1020,
        "y": 540,
        "wires": [
            []
        ]
    },
    {
        "id": "417ac20ebe3f2a86",
        "type": "json",
        "z": "81e91fe521078ee2",
        "name": "",
        "property": "payload",
        "action": "str",
        "pretty": false,
        "x": 550,
        "y": 540,
        "wires": [
            [
                "1a430109f61e57aa",
                "e1161d883340cd51"
            ]
        ]
    },
    {
        "id": "e1161d883340cd51",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 750,
        "y": 620,
        "wires": []
    },
    {
        "id": "506e93ae9b6d2e57",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1030,
        "y": 620,
        "wires": []
    },
    {
        "id": "a6c56029eec82a09",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "I've tried several methods, but the output files are all corrupt; this node I can't get a reference to the example",
        "info": "",
        "x": 1060,
        "y": 500,
        "wires": []
    }
]

I'm from China, maybe due to the time difference I can't interact in time, hope someone can help me, I've been trying for a few days but still failed

have raised an issue and waiting for the author to respond.

sorry for tagging you @mdkrieg, if you could suggest if we can do this ?

I sorted out my needs, can anyone help me?

[
    {
        "id": "1502ffe3922a84f9",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 60,
        "wires": [
            [
                "6c5a46c348fb7688"
            ]
        ]
    },
    {
        "id": "94e8f4497d62d569",
        "type": "excelsheets",
        "z": "81e91fe521078ee2",
        "name": "",
        "file": "C:\\Users\\User\\Desktop\\output.xlsx",
        "x": 530,
        "y": 60,
        "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: \"899\",\n            }\n        ] ,\n        sheetName: \"2号主机\"\n    } ,\n    // {header, items, sheetName} ,\n    // {header, items, sheetName} ,\n    // {header, items, sheetName} \n];\n// msg.filepath=\"C:\\Users\\User\\Desktop\\output.xlsx\";\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 60,
        "wires": [
            [
                "94e8f4497d62d569"
            ]
        ]
    },
    {
        "id": "c9ed56984190b95d",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "When I repeat the injection, the previous data in execl is overwritten",
        "info": "",
        "x": 700,
        "y": 100,
        "wires": []
    },
    {
        "id": "b1a9abafe7a0dd64",
        "type": "excel",
        "z": "81e91fe521078ee2",
        "name": "excel",
        "file": "C:\\Users\\User\\Desktop\\666.xlsx",
        "x": 510,
        "y": 220,
        "wires": [
            []
        ]
    },
    {
        "id": "1a430109f61e57aa",
        "type": "xlsx-out",
        "z": "81e91fe521078ee2",
        "name": "xlsx-out",
        "sheetName": "test",
        "x": 720,
        "y": 400,
        "wires": [
            [
                "4b65ddf15b516640",
                "506e93ae9b6d2e57"
            ]
        ]
    },
    {
        "id": "876da1bea0183b7d",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 220,
        "wires": [
            [
                "f633ab87b184dec6"
            ]
        ]
    },
    {
        "id": "f0426b0398f4445f",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 530,
        "y": 180,
        "wires": []
    },
    {
        "id": "f633ab87b184dec6",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "",
        "func": "msg.payload= [\n    {\n        \"gkj\":1,\n        b:2,\n    },\n    //     {\n    //     c:11,\n    //     d:22,\n    // },\n    ];\n\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 220,
        "wires": [
            [
                "f0426b0398f4445f",
                "b1a9abafe7a0dd64"
            ]
        ]
    },
    {
        "id": "578a2d608e348863",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "When I repeat the injection, the previous data is overwritten and 2 sheets cannot be created",
        "info": "",
        "x": 770,
        "y": 260,
        "wires": []
    },
    {
        "id": "29e5774f88867339",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "chiller01",
        "func": "msg.sheetName=\"chiller01\"\nmsg.payload=[\n   {\n            col1: \"记录时间\",\n            col2: \"温度\",\n            col3: \"湿度\"\n        } ,\n            {\n            col1: \"2022\",\n            col2: \"115\",\n            col3: \"252\",\n            }\n        ] \nmsg.fileName=\"C:\\Users\\User\\Desktop\\999.xlsx\"\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 400,
        "wires": [
            [
                "417ac20ebe3f2a86"
            ]
        ]
    },
    {
        "id": "cd42f86717242e4d",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 400,
        "wires": [
            [
                "29e5774f88867339"
            ]
        ]
    },
    {
        "id": "5b6c585b086827d7",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "chiller02",
        "func": "msg.sheetName=\"chiller02\"\nmsg.payload= [5,6,7,8];\nreturn msg;\n",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 320,
        "y": 480,
        "wires": [
            [
                "417ac20ebe3f2a86"
            ]
        ]
    },
    {
        "id": "bf18c1beecb0f4d0",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 480,
        "wires": [
            [
                "5b6c585b086827d7"
            ]
        ]
    },
    {
        "id": "4b65ddf15b516640",
        "type": "file",
        "z": "81e91fe521078ee2",
        "name": "write file",
        "filename": "C:\\Users\\User\\Desktop\\999.xlsx",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "false",
        "encoding": "GB2312",
        "x": 1000,
        "y": 400,
        "wires": [
            []
        ]
    },
    {
        "id": "417ac20ebe3f2a86",
        "type": "json",
        "z": "81e91fe521078ee2",
        "name": "",
        "property": "payload",
        "action": "str",
        "pretty": false,
        "x": 530,
        "y": 400,
        "wires": [
            [
                "1a430109f61e57aa",
                "e1161d883340cd51"
            ]
        ]
    },
    {
        "id": "e1161d883340cd51",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 730,
        "y": 480,
        "wires": []
    },
    {
        "id": "506e93ae9b6d2e57",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "false",
        "statusVal": "",
        "statusType": "auto",
        "x": 1010,
        "y": 480,
        "wires": []
    },
    {
        "id": "a6c56029eec82a09",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "I've tried several methods, but the output files are all corrupt; this node I can't get a reference to the example",
        "info": "",
        "x": 1000,
        "y": 360,
        "wires": []
    },
    {
        "id": "eaf7d50086a0b711",
        "type": "file",
        "z": "81e91fe521078ee2",
        "name": "jjjj",
        "filename": "C:\\Users\\User\\Desktop\\999.csv",
        "appendNewline": false,
        "createDir": true,
        "overwriteFile": "false",
        "encoding": "GB2312",
        "x": 610,
        "y": 640,
        "wires": [
            [
                "1560169b146af371"
            ]
        ]
    },
    {
        "id": "1560169b146af371",
        "type": "debug",
        "z": "81e91fe521078ee2",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 770,
        "y": 640,
        "wires": []
    },
    {
        "id": "5735fa47723d9f39",
        "type": "function",
        "z": "81e91fe521078ee2",
        "name": "",
        "func": "msg.sheetname=\"chiller02\"\nmsg.payload={\n   \n   \"记录时间\":777,\n   \"温   度\":888,\n//空格的格式必要要与后面的csv要保持一直,否则后面不识别数据\n   \"湿   度\":9999,\n}\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 290,
        "y": 640,
        "wires": [
            [
                "ca6fba07024bc5a5"
            ]
        ]
    },
    {
        "id": "72f6a40c8099330e",
        "type": "inject",
        "z": "81e91fe521078ee2",
        "name": "",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "true",
        "payloadType": "bool",
        "x": 130,
        "y": 640,
        "wires": [
            [
                "5735fa47723d9f39"
            ]
        ]
    },
    {
        "id": "ca6fba07024bc5a5",
        "type": "csv",
        "z": "81e91fe521078ee2",
        "name": "js转CSV",
        "sep": ",",
        "hdrin": true,
        "hdrout": "once",
        "multi": "mult",
        "ret": "\\r\\n",
        "temp": "记录时间,温   度,湿   度",
        "skip": "0",
        "strings": true,
        "include_empty_strings": "",
        "include_null_values": "",
        "x": 460,
        "y": 640,
        "wires": [
            [
                "eaf7d50086a0b711"
            ]
        ]
    },
    {
        "id": "d2aee75cfd5ca973",
        "type": "comment",
        "z": "81e91fe521078ee2",
        "name": "CSV has only one sheet and does not meet my needs",
        "info": "",
        "x": 920,
        "y": 600,
        "wires": []
    }
]

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