String of data to file or CSV node

Hi all,
I have a bit of an interesting issue as I am recently trying out data pull from an api.
I managed to get the data to stream back i believe in a string? I can write it to an excel
file but something weird happens where row 2 seems to "split" unlike any of the other rows.
How can I catch the "culprit" thats causing this? or filter out the anomaly ? I have used a
debug node in multiple places to see where this is . but no luck. Row 1-3 are columb titles.
the rest is data. I have not used the CSV node before and when I try put that data through it
it comes out with only row 1 with something thats unexpected .

Please if anyone could help.
Thanks all

Feed the offending section into a debug node and show us what it contains and also show us what the excel file looks like.

Hi and thanks for the reply,
here is the output of the http get request

""timestamp","Gateway [0]","Gateway [0]","Gateway [0]","Gateway [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [51..."

Here is the part of the flow.

[{"id":"905e785d.2ee348","type":"http request","z":"a1b3b72f.6ce7d","name":"","method":"GET","ret":"txt","paytoqs":"query","url":"https://vrmapi.victronenergy.com/v2/installations/data-download?type=log&start=1622505600&end=1622764800&format=csv","tls":"","persist":false,"proxy":"","authType":"","x":550,"y":120,"wires":[["9ba1321.e5a48d","a62b13cc.55948"]]},{"id":"a62b13cc.55948","type":"file","z":"a1b3b72f.6ce7d","name":"","filename":"C:\\tty\\new2.csv","appendNewline":true,"createDir":true,"overwriteFile":"true","encoding":"utf8","x":1120,"y":160,"wires":[["1fe3b76c.c233b9"]]}]

Lastly Ive attached the excel sheet how it appears after it prints to file.
okay it wont let me upload it normally...ive renamed the file New2.txt
originally it was New2.csv
New2 .txt (11.0 KB)

We can't see the complete input. Feed it into a debug node and hover over the value in the debug node and click the Copy Value button that appears. Then paste it here. Is it supposed to have all those repeated column names, "Gateway [0]" for example

Also tell us what the csv file should look like.

I see that you have told the http node to append msg.payload to the query parameters, did you mean to do that?

[Edit] Actually don't paste the request output all here. Just paste the first two lines to keep the size down.

Hey there,

Sorry for the delay, but here is the ouput of the debug. But note its really not helpful
nor do I know how to get the right value out of it. I promise this is exactly what hits
the debug node after the HTTP node

"timestamp","Gateway [0]","Gateway [0]","Gateway [0]","Gateway [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","VE.Bus System [0]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [512]","Battery Monitor [51...

Its like it cant print the full output? but the file node processes it all.
I noticed that on the export to but on the file node those options are not ticked.
I have manually formatted at csv file to reflect what its supposed to look like.
Keeping in mind this is once again New5.txt which is actually New5.csv .
New5 .txt (4.1 KB)

Its really weird that this is the ouput i get from debug. If you compare the raw write
to the csv file New2.txt and the correctly manually formated file New5.txt

The debug pane truncates long results to save overloading the debug output. Did you use the Copy Value button as I suggested? That should have copied the whole payload even though it is not displayed. That is why I said to use the button.

Try this

[{"id":"7c1869f1.da949","type":"inject","z":"c74669a0.6a34f8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"\"\"timestamp\",\"Gateway [0]\",\"Gateway [0]\",\"Gateway [0]\",\"Gateway [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [51...\"","payloadType":"str","x":130,"y":3860,"wires":[["576c88e1.15e89"]]},{"id":"576c88e1.15e89","type":"template","z":"c74669a0.6a34f8","name":"simulate http response","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"\"timestamp\",\"Gateway [0]\",\"Gateway [0]\",\"Gateway [0]\",\"Gateway [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"VE.Bus System [0]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"Battery Monitor [512]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"System overview [0]\",\"Generator start/stop [0]\";\n\"Africa/Johannesburg (+02:00),\"VRM Log time offset\",\"ESS Scheduled Charging\",\"Relay 1 state\",\"Generator run reason\",\"Phase rotation\",\"Input voltage phase 1\",\"Input current phase 1\",\"Input frequency 1\",\"Input power 1\",\"Output voltage phase 1\",\"Output current phase 1\",\"Output frequency\",\"Output power 1\",\"Voltage\",\"Current\",\"Battery temperature\",\"Active input\",\"Active input current limit\",\"VE.Bus state\",\"VE.Bus Error\",\"Switch Position\",\"Temperature\",\"Low battery\",\"Overload\",\"Temperatur sensor alarm\",\"Voltage sensor alarm\",\"High DC Ripple\",\"Temperature L1\",\"Low battery L1\",\"Overload L1\",\"High DC Ripple L1\",\"Temperature L2\",\"Low battery L2\",\"Overload L2\",\"High DC Ripple L2\",\"Temperature L3\",\"Low battery L3\",\"Overload L3\",\"High DC Ripple L3\",\"Charge state\",\"Voltage\",\"Current\",\"Battery temperature\",\"State of charge\",\"State of health\",\"CVL - Charge Voltage Limit\",\"CCL - Charge Current Limit\",\"DCL - Discharge Current Limit\",\"Low voltage alarm\",\"High voltage alarm\",\"Low battery temperature alarm\",\"High battery temperature alarm\",\"Cell Imbalance alarm\",\"High charge current alarm\",\"High discharge current alarm\",\"High charge temperature alarm\",\"Low charge temperature alarm\",\"Internal error alarm\",\"AC-Input\",\"Grid alarm\",\"AC Consumption L1\",\"Grid L1\",\"Voltage\",\"Battery State of Charge\",\"DVCC Multiple batteries alarm\",\"GX Error #48 DVCC with incompatible firmware\",\"No grid meter alarm\",\"#1 Low SOC\";\" discharge disabled\",\"#2 BatteryLife is active\",\"#3 Charge disabled by BMS\",\"#4 Discharge disabled by BMS\",\"#5 Slow charge is active\",\"#6 Charge disabled by user setting\",\"#7 Discharge disabled by user setting\",\"Current\",\"VE.Bus charge current\",\"Battery Power\",\"VE.Bus charge power\",\"Battery state\",\"Generator not detected at AC-input\" \",\"s\",\",\",\",\",\"VAC\",\"A\",\"Hz\",\"W\",\"VAC\",\"A\",\"Hz\",\"W\",\"V\",\"A\",\"C\",\",\"A\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\",\"V\",\"A\",\"C\",\"%\",\"%\",\"V\",\"A\",\"A\",\",\",\",\",\",\",\",\",\",\",\",\",\"W\",\"W\",\"V\",\"%\",\",\",\",\",\",\",\",\",\",\",\"A\",\"A\",\"W\",\"W\",\",\"\";\n\"2021-06-01 02:00:28\",\"2\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"230.2\",\"7.1\",\"50.10\",\"1500\",\"230.2\",\"3.8\",\"49.95\",\"867\",\"55.52\",\"3.4\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.91\",\"2.50\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"846\",\"968\",\"54.91\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"2.50\",\"3.4\",\"137.000000\",\"122\",\"charging\",\"No alarm\";\n\"2021-06-01 02:01:29\",\"0\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"230.2\",\"4.5\",\"50.10\",\"707\",\"230.2\",\"4.9\",\"49.95\",\"858\",\"54.78\",\"-4.2\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.74\",\"-5.20\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"858\",\"707\",\"54.74\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-5.20\",\"-4.2\",\"-284.000000\",\"-123\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:02:28\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"230.2\",\"7.1\",\"50.10\",\"1505\",\"230.2\",\"4.0\",\"49.95\",\"852\",\"55.28\",\"11.1\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"55.08\",\"11.20\",\"22\",\"99.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"852\",\"1505\",\"55.07\",\"99.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"3.30\",\"11.1\",\"181.000000\",\"182\",\"charging\",\"No alarm\";\n\"2021-06-01 02:03:29\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"3.3\",\"50.10\",\"429\",\"229.2\",\"5.0\",\"49.95\",\"875\",\"54.66\",\"-8.6\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.71\",\"-6.70\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"875\",\"429\",\"54.67\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-10.40\",\"-8.6\",\"-568.000000\",\"-722\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:04:29\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"4.5\",\"50.10\",\"752\",\"229.2\",\"4.9\",\"49.82\",\"810\",\"54.94\",\"-1.4\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.88\",\"-2.90\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"810\",\"752\",\"54.88\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-2.90\",\"-1.4\",\"-159.000000\",\"-140\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:05:28\",\"2\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"4.1\",\"49.85\",\"753\",\"229.2\",\"4.6\",\"49.82\",\"816\",\"54.94\",\"-1.7\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.90\",\"-2.60\",\"22\",\"99.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"827\",\"792\",\"54.93\",\"99.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-0.90\",\"-1.2\",\"-49.000000\",\"-35\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:06:29\",\"0\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"5.2\",\"49.85\",\"1479\",\"228.2\",\"4.0\",\"49.69\",\"1177\",\"55.30\",\"4.7\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"55.19\",\"4.80\",\"22\",\"99.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"1177\",\"1567\",\"55.21\",\"99.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"7.50\",\"8.8\",\"414.000000\",\"612\",\"charging\",\"No alarm\";\n\"2021-06-01 02:07:28\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"4.5\",\"49.85\",\"796\",\"229.2\",\"4.9\",\"49.69\",\"829\",\"54.91\",\"-1.3\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.86\",\"0.00\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"877\",\"796\",\"54.86\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"0.00\",\"-1.3\",\"0.000000\",\"53\",\"idle\",\"No alarm\";\n\"2021-06-01 02:08:29\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"230.2\",\"4.1\",\"49.85\",\"1127\",\"230.2\",\"4.9\",\"49.69\",\"1350\",\"54.83\",\"-4.8\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.80\",\"-1.30\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"1350\",\"1127\",\"54.78\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-3.80\",\"-2.0\",\"-208.000000\",\"-606\",\"discharging\",\"No alarm\";","output":"str","x":290,"y":3820,"wires":[["b7820048.961158"]]},{"id":"b7820048.961158","type":"function","z":"c74669a0.6a34f8","name":"","func":"let lines = msg.payload.split(/\\n/);\nmsg.payload=\"\";\nfor(let i = 0; i < lines.length; i++){\n    msg.payload += lines[i].replace(/\"|;/g, \"\").replace(/,/g,\";\")+\"\\n\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":3860,"wires":[["7d2fb4ee.93aa3c","a62b13cc.55948"]]},{"id":"7d2fb4ee.93aa3c","type":"debug","z":"c74669a0.6a34f8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":620,"y":3780,"wires":[]},{"id":"a62b13cc.55948","type":"file","z":"c74669a0.6a34f8","name":"","filename":"new1.csv","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"utf8","x":630,"y":3860,"wires":[[]]}]larm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-2.90\",\"-1.4\",\"-159.000000\",\"-140\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:05:28\",\"2\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"4.1\",\"49.85\",\"753\",\"229.2\",\"4.6\",\"49.82\",\"816\",\"54.94\",\"-1.7\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.90\",\"-2.60\",\"22\",\"99.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"827\",\"792\",\"54.93\",\"99.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-0.90\",\"-1.2\",\"-49.000000\",\"-35\",\"discharging\",\"No alarm\";\n\"2021-06-01 02:06:29\",\"0\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"5.2\",\"49.85\",\"1479\",\"228.2\",\"4.0\",\"49.69\",\"1177\",\"55.30\",\"4.7\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"55.19\",\"4.80\",\"22\",\"99.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"1177\",\"1567\",\"55.21\",\"99.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"7.50\",\"8.8\",\"414.000000\",\"612\",\"charging\",\"No alarm\";\n\"2021-06-01 02:07:28\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"229.2\",\"4.5\",\"49.85\",\"796\",\"229.2\",\"4.9\",\"49.69\",\"829\",\"54.91\",\"-1.3\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.86\",\"0.00\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"877\",\"796\",\"54.86\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"0.00\",\"-1.3\",\"0.000000\",\"53\",\"idle\",\"No alarm\";\n\"2021-06-01 02:08:29\",\"1\",\"Not active\",\"Open\",\"Stopped\",\"Ok\",\"230.2\",\"4.1\",\"49.85\",\"1127\",\"230.2\",\"4.9\",\"49.69\",\"1350\",\"54.83\",\"-4.8\",\"22\",\"AC Input 1\",\"50.00\",\"Float\",\"No error\",\"On\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Ok\",\"Float\",\"54.80\",\"-1.30\",\"22\",\"100.0\",\"100.0\",\"56.0\",\"50.0\",\"80.0\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"Grid\",\"Grid ok\",\"1350\",\"1127\",\"54.78\",\"100.0\",\"No alarm\",\"No alarm\",\"OK\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"Off\",\"-3.80\",\"-2.0\",\"-208.000000\",\"-606\",\"discharging\",\"No alarm\";","output":"str","x":270,"y":3800,"wires":[["b7820048.961158"]]},{"id":"b7820048.961158","type":"function","z":"c74669a0.6a34f8","name":"","func":"let lines = msg.payload.split(/\\n/);\nmsg.payload=\"<pre>\";\nfor(let i = 0; i < lines.length; i++){\n    msg.payload += lines[i].replace(/\"|;/g, \"\").replace(/,/g,\";\")+\"\\n\"\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":450,"y":3860,"wires":[["a62b13cc.55948"]]},{"id":"a62b13cc.55948","type":"file","z":"c74669a0.6a34f8","name":"","filename":"new1.csv","appendNewline":false,"createDir":false,"overwriteFile":"true","encoding":"utf8","x":630,"y":3860,"wires":[[]]}]\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",\"No alarm\",

It should retrun a text string formatted as new5.csv. If i have simulated your http request correctly.

unfortunately yes I used the button called copy value in the debug message
which is at the top right corner of the message. There was a suggestion
to use a function node to print to consol? would this work as an option?

i copied this and tried to paste it into my flow but its not recognizing it for some reason.
I am however going line by line to see whats created and see if i can replicate it

Gents I have some good news, I managed to find the offending character causing the CSV to bug out.
So I printed to consol and found the odd character ; . after using a change node to remove it. The
ouput to column A looks good. Now its to somehow automatically perform the text to columns conversion
on a difference sheet. Any ideas?

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