# Excel separar columna-node-red

**URL:** <https://discourse.nodered.org/t/excel-separar-columna-node-red/67524>\
**Category:** General\
**Tags:** function-node\
**Created:** [9 September 2022 15:28 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524 "2022-09-09T15:28:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Mariano](https://discourse.nodered.org/u/Mariano)\
**Post date:** [9 September 2022 15:28 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/1 "2022-09-09T15:28:40Z")

</div>

Hello, I wanted to save the voltage data to an excel with the date and time, but they are stored in the same column, does anyone know how to separate them?

 ![excel](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/f/1fe8021e88113f831ededc05825e93a4d03bac1a.jpeg)

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 September 2022 08:01 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/2 "2022-09-10T08:01:38Z")

</div>

@Mariano welcome to the forum! So what have you tried so far?

If you create a small example flow that reproduces your issue and export it and paste it to a reply, it will make it easier for someone to help you.

In order to make code readable and usable it is necessary to surround your code with three backticks (also known as a left quote or backquote `````)

````auto
``` 
   code goes here 
```

````

You can edit and correct your post by clicking the pencil ✏ icon.

See this post for more details - [How to share code or flow json](https://discourse.nodered.org/t/how-to-share-code-or-flow-json/506)

---

<div class="post-metadata">

**Author:** ![Mariano](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Mariano](https://discourse.nodered.org/u/Mariano)\
**Post date:** [12 September 2022 13:46 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/3 "2022-09-12T13:46:10Z")

</div>

Thanks for your time, I leave you my code so you can see it. 😄

```auto
[
    {
        "id": "04c3f6fabe43a461",
        "type": "function",
        "z": "8f292025fe253f81",
        "name": "Datos",
        "func": "var d= new Date ();\nvar time= d.toLocaleTimeString();\nvar s= {'time':time,'sepam':sepam};\nvar sepam=msg.payloand\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 330,
        "y": 300,
        "wires": [
            [
                "2962396ed51da88c"
            ]
        ]
    },
    {
        "id": "8a0cffa84df7cbc8",
        "type": "function",
        "z": "8f292025fe253f81",
        "name": "fecha excel",
        "func": "var d = new Date()\nvar date = d.getFullYear()+\"/\"+(d.getMonth()+1)+\"/\"+d.getDate()+\" \"+d.getHours()+\":\"+d.getMinutes()+\":\"+d.getSeconds();\nmsg.payload = date\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 350,
        "y": 260,
        "wires": [
            [
                "2962396ed51da88c"
            ]
        ]
    },
    {
        "id": "ced8e6d520d9bc24",
        "type": "debug",
        "z": "8f292025fe253f81",
        "name": "lectura",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "",
        "statusType": "auto",
        "x": 870,
        "y": 280,
        "wires": []
    },
    {
        "id": "2962396ed51da88c",
        "type": "file",
        "z": "8f292025fe253f81",
        "name": "",
        "filename": "C:\\Lectura de datos\\Registro de datos.csv",
        "filenameType": "str",
        "appendNewline": true,
        "createDir": false,
        "overwriteFile": "false",
        "encoding": "none",
        "x": 640,
        "y": 280,
        "wires": [
            [
                "ced8e6d520d9bc24"
            ]
        ]
    },
    {
        "id": "ada1cccb4917558c",
        "type": "modbus-read",
        "z": "8f292025fe253f81",
        "name": "Sepam",
        "topic": "",
        "showStatusActivities": false,
        "logIOActivities": false,
        "showErrors": false,
        "unitid": "",
        "dataType": "HoldingRegister",
        "adr": "286",
        "quantity": "1",
        "rate": "10",
        "rateUnit": "s",
        "delayOnStart": false,
        "startDelayTime": "",
        "server": "d91e649d.344078",
        "useIOFile": false,
        "ioFile": "",
        "useIOForPayload": false,
        "emptyMsgOnFail": false,
        "x": 130,
        "y": 280,
        "wires": [
            [
                "8a0cffa84df7cbc8",
                "04c3f6fabe43a461"
            ],
            []
        ]
    },
    {
        "id": "d91e649d.344078",
        "type": "modbus-client",
        "name": "Medidor",
        "clienttype": "tcp",
        "bufferCommands": true,
        "stateLogEnabled": false,
        "queueLogEnabled": false,
        "failureLogEnabled": false,
        "tcpHost": "192.168.0.87",
        "tcpPort": "502",
        "tcpType": "DEFAULT",
        "serialPort": "/dev/ttyUSB",
        "serialType": "RTU-BUFFERD",
        "serialBaudrate": "9600",
        "serialDatabits": "8",
        "serialStopbits": "1",
        "serialParity": "none",
        "serialConnectionDelay": "100",
        "serialAsciiResponseStartDelimiter": "",
        "unit_id": "1",
        "commandDelay": "1",
        "clientTimeout": "500",
        "reconnectOnTimeout": false,
        "reconnectTimeout": "500",
        "parallelUnitIdsAllowed": true
    }
]

```

I already tried to unite everything in the same function but I got an error

---

<div class="post-metadata">

**Author:** ![dynamicdave](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dynamicdave/32/96_2.png) [@dynamicdave](https://discourse.nodered.org/u/dynamicdave)\
**Post date:** [12 September 2022 14:17 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/4 "2022-09-12T14:17:08Z")

</div>

I am unable to import your flow.  
You need to follow the instructions that @zenofmud posted above.  
I suspect you did not use the three back ticks ```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [12 September 2022 14:18 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/5 "2022-09-12T14:18:17Z")

</div>

1. you did not post your code in a format that makes it importable - did you read the directions I posted?
2. You did not create a flow with any input data that demonstrated the problem.
3. why do you have two function nodes processing the data? the will each send a seperate msg to the file-write node. If you want the data on the same line you will need a `join` node or combine the two `function` nodes into one.
4. your 'Datos' `function` does nothing, it gets a msg in and then sends the same msg out without changing the msg at all,

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 November 2022 14:19 UTC](https://discourse.nodered.org/t/excel-separar-columna-node-red/67524/6 "2022-11-11T14:19:06Z")

</div>

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