Change function to read .txt file for chart

Hi, I am having an issue trying to format my .txt to be able to display on my chart.

Currently my .txt is displaying like this and I’m able to shore data on graph:
4,2020-11-02,18:28:37

However, my .txt is being changed to this and I need help on how to change it:
2020-11-02 18:28:37 4

Please all help is gladly appreciated. Here is my flow:

[{"id":"83afaffb.3b3b8","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"5b05e4d0.376cbc","type":"ui_date_picker","z":"83afaffb.3b3b8","d":true,"name":"","label":"date","group":"f2049ccb.8069d","order":3,"width":0,"height":0,"passthru":true,"topic":"","x":90,"y":200,"wires":[[]]},{"id":"34e601e9.f5a0fe","type":"ui_text","z":"83afaffb.3b3b8","d":true,"group":"f2049ccb.8069d","order":1,"width":0,"height":0,"name":"","label":"Customer Tracker","format":"{{msg.payload}}","layout":"row-spread","x":330,"y":160,"wires":[]},{"id":"49a290d7.b57b2","type":"ui_text","z":"83afaffb.3b3b8","d":true,"group":"f2049ccb.8069d","order":2,"width":0,"height":0,"name":"","label":"Current visitors: ","format":"{{msg.currentVisitors}}","layout":"row-spread","x":120,"y":160,"wires":[]},{"id":"5dac79d1.b216c8","type":"ui_chart","z":"83afaffb.3b3b8","d":true,"name":"","group":"f2049ccb.8069d","order":4,"width":0,"height":0,"label":"Visitors in the Store","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"500","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":250,"y":200,"wires":[[]]},{"id":"9a93de94.d4315","type":"ui_toast","z":"83afaffb.3b3b8","d":true,"position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":true,"topic":"","name":"Attendant needed for Cart Collection","x":330,"y":240,"wires":[]},{"id":"fc31e116.b524b","type":"ui_text_input","z":"83afaffb.3b3b8","d":true,"name":"","label":"","tooltip":"","group":"f2049ccb.8069d","order":5,"width":0,"height":0,"passthru":true,"mode":"text","delay":300,"topic":"","x":100,"y":240,"wires":[["9a93de94.d4315"]]},{"id":"a90dcc8a.b385d","type":"inject","z":"83afaffb.3b3b8","d":true,"name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":100,"y":400,"wires":[["5b7951c7.b0fa5"]]},{"id":"77bf8b0.fc7be74","type":"debug","z":"83afaffb.3b3b8","d":true,"name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":290,"y":500,"wires":[]},{"id":"5b7951c7.b0fa5","type":"function","z":"83afaffb.3b3b8","d":true,"name":"","func":"for (var i=0; i<400; i++){\n    node.send({payload:i});\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":100,"y":460,"wires":[["2241e549.57e14a"]]},{"id":"2241e549.57e14a","type":"delay","z":"83afaffb.3b3b8","d":true,"name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":110,"y":520,"wires":[["77bf8b0.fc7be74"]]},{"id":"af5a72c.966599","type":"inject","z":"83afaffb.3b3b8","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"100","payloadType":"num","x":80,"y":760,"wires":[["a17bdf83.68828"]]},{"id":"a17bdf83.68828","type":"function","z":"83afaffb.3b3b8","d":true,"name":"","func":"m = msg.payload;\nt = msg.topic;\n\nif (m === null) {\n        n = 0;\n    }\n\n  /*  \n  var n = localStorage.getItem('on_load_counter');\n\n    if (n === null) {\n        n = 0;\n    }\n\n    n++;\n\n    localStorage.setItem(\"on_load_counter\", n);\n\n    document.getElementById('CounterVisitor').innerHTML = n;\n*/\n\n/*\nif (value > 0) {\n        counter = value;\n    } else {\n        counter = 0;\n    }*/ \n    \nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":760,"wires":[["6cd49acb.8b2dc4"]]},{"id":"6cd49acb.8b2dc4","type":"debug","z":"83afaffb.3b3b8","d":true,"name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":500,"y":760,"wires":[]},{"id":"4e0aab3b.54ee74","type":"trigger","z":"83afaffb.3b3b8","d":true,"name":"Notification","op1":"","op2":"0","op1type":"pay","op2type":"str","duration":"0","extend":false,"units":"min","reset":"42","bytopic":"all","topic":"topic","outputs":1,"x":550,"y":1143,"wires":[["7e85fea1.df0e3"]]},{"id":"4c7bfad1.4188f4","type":"switch","z":"83afaffb.3b3b8","d":true,"name":"","property":"payload","propertyType":"msg","rules":[{"t":"eq","v":"Empty","vt":"str"},{"t":"eq","v":"Full","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":270,"y":800,"wires":[[],[]]},{"id":"7365a220.e6887c","type":"inject","z":"83afaffb.3b3b8","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":80,"y":800,"wires":[[]]},{"id":"7e85fea1.df0e3","type":"ui_toast","z":"83afaffb.3b3b8","d":true,"position":"dialog","displayTime":"1","highlight":"","sendall":true,"outputs":1,"ok":"OK","cancel":"CLOSE","raw":false,"topic":"","name":"","x":730,"y":1143,"wires":[[]]},{"id":"df16ba6f.b5ed98","type":"function","z":"83afaffb.3b3b8","d":true,"name":"","func":"inside = msg.payload;\noutside = msg.topic;\n\nvisitors = inside - outside\n\n/* if (inside === null) {\n        inside = 0;\n    }\n    \n    else if \n    */\n\n  /*  \n  var n = localStorage.getItem('on_load_counter');\n\n    if (n === null) {\n        n = 0;\n    }\n\n    n++;\n\n    localStorage.setItem(\"on_load_counter\", n);\n\n    document.getElementById('CounterVisitor').innerHTML = n;\n*/\n\n/*\nif (value > 0) {\n        counter = value;\n    } else {\n        counter = 0;\n    }*/ \n    \nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":280,"y":720,"wires":[[]]},{"id":"af32e6bf.d49b88","type":"ui_template","z":"83afaffb.3b3b8","d":true,"group":"754f26ec.f54098","name":"fileInput","order":0,"width":"6","height":"1","format":"<div class=\"fileContainer\">\n    <input type=\"file\" name=\"file\" id=\"file\" class=\"inputfile\" />\n    <label for=\"file\">File</label>\n    <p style=\"margin:auto\" id=\"fileName\"></p>\n    <button class=\"vibrate filled touched smallfont rounded greybuttons\" ng-click=\"clear()\"> \n       <ng-md-icon style=\"color: #fff;\" icon=\"clear\">\n            <md-tooltip md-direction=\"bottom\">CLEAR</md-tooltip>\n        </ng-md-icon>\n    </button> \n</div>\n\n<style>\n    .fileContainer {\n        display: flex;\n    }\n    .inputfile {\n\twidth: 0.1px;\n\theight: 0.1px;\n\topacity: 0;\n\toverflow: hidden;\n\tposition: absolute;\n\tz-index: -1;\n}\n\n.inputfile + label {\n    font-size: 1.25em;\n    font-weight: 700;\n    color: white;\n    text-align: center;\n    padding: 5px;\n    width: 60px;\n    background-color: black;\n}\n\n.inputfile:focus + label,\n.inputfile + label:hover {\n    background-color: red;\n}\n\n.inputfile + label {\n\tcursor: pointer; /* \"hand\" cursor */\n}\n\n.inputfile:focus + label {\n\toutline: 1px dotted #000;\n\toutline: -webkit-focus-ring-color auto 5px;\n}\n\n.inputfile + label * {\n\tpointer-events: none;\n}\n\n</style>\n\n<script>\n(function(scope) {\n   var fileInput = $('#file')\n   var fileName = $('#fileName')\n   \n   scope.clear = function() {\n       fileInput.val('').trigger('change')\n   }\n   \n   fileInput.on('change', function(event) {\n        var file = fileInput[0].files[0]; \n        \n        fileName.text(file ? file.name : '')\n        \n        if(file) {\n       \n            var reader = new FileReader();\n            reader.readAsBinaryString(file);\n        \n            reader.onload = function() {\n                scope.send({payload: reader.result, file: file.name})\n            };\n            reader.onerror = function() {\n                console.log('Error while reading files');\n            };\n        } else\n            scope.send({payload: null})\n   })\n    \n})(scope);\n</script>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":80,"y":900,"wires":[["ddc659f0.778d98","c10c65d7.4485f8"]]},{"id":"c10c65d7.4485f8","type":"function","z":"83afaffb.3b3b8","d":true,"name":"","func":"var toDelete = !msg.payload\n\nif(!toDelete) {\n    var buffer = new Buffer(msg.payload, \"binary\");\n    node.send({topic: 'create', payload: buffer, filename: 'files/' + msg.file})\n    flow.set('file', msg.file.name)\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":283,"y":901,"wires":[["e4e08715.d78618"]]},{"id":"e4e08715.d78618","type":"file","z":"83afaffb.3b3b8","d":true,"name":"","filename":"","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":519,"y":902,"wires":[[]]},{"id":"ddc659f0.778d98","type":"exec","z":"83afaffb.3b3b8","d":true,"command":"rm -rf files/*","addpay":false,"append":"","useSpawn":"false","timer":"","oldrc":false,"name":"","x":307,"y":970,"wires":[[],[],[]]},{"id":"5ff0f263.c62e1c","type":"comment","z":"83afaffb.3b3b8","d":true,"name":"Just a live view of cameras","info":"","x":190,"y":1618,"wires":[]},{"id":"a8975bf6.441168","type":"inject","z":"83afaffb.3b3b8","d":true,"name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"30","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"checkWeb","payloadType":"str","x":150,"y":1718,"wires":[["59e4e15d.ac81c"]]},{"id":"59e4e15d.ac81c","type":"ui_template","z":"83afaffb.3b3b8","d":true,"group":"e56f5108.01102","name":"Just a view of cameras","order":1,"width":"35","height":"12","format":"<!DOCTYPE html>\n<html>\n<style>\nimg {\n    border: 1px solid #ddd;\n    border-radius: 8px;\n    padding: 2px;\n    width: 405px;\n}\n</style>\n\n<script type=\"text/javascript\">\nscope.$watch('msg', function(msg) {\n    inMessage(msg.payload);\n});\n\nfunction updatePic() {\n    document.getElementById('c51').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c52').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c53').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c54').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c55').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c56').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c57').src = \"http://192.168.0.234:8081/1/stream\";\n    document.getElementById('c58').src = \"http://192.168.0.234:8081/1/stream\";\n    //alert('updated pics');\n}\n\nfunction inMessage(event) {\n    if (event.match('checkWeb')) {\n        updatePic();\n    }\n}\n\n</script>\n<center>\n<table>\n    <tr><!-- Row 1 -->\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c51\" /></td>\n   \t\t    <td style=\"text-align: center\"><img src=\"\" id=\"c52\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c53\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c54\" /></td>\n    </tr>\n    <tr><!-- Row 2 -->\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c55\" /></td>\n   \t\t    <td style=\"text-align: center\"><img src=\"\" id=\"c56\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c57\" /></td>\n    \t\t<td style=\"text-align: center\"><img src=\"\" id=\"c58\" /></td>\n    </tr>\n</table>\n</center>\n</html>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":380,"y":1718,"wires":[[]]},{"id":"921878c7.455d08","type":"ui_template","z":"83afaffb.3b3b8","d":true,"group":"e56f5108.01102","name":"Clock Toolbar","order":5,"width":"0","height":"0","format":"\n<script id=\"titleScript\" type=\"text/javascript\">\n    $('#clock').remove();\n    var toolbar = $('.md-toolbar-tools');\n    var div = $('<div></div>');\n    var p = $('<p/ id=\"clock\">');\n    $('#titleScript').parent().hide();\n    div.append(p);\n    div[0].style.margin = '5px 5px 5px auto';\n    toolbar.append(div);\n\n    function displayTitle(lh) {\n        p.text(lh); \n    }\n    \n    function upTime() {\n        var d = new Date();\n        p.text(d.toLocaleTimeString('de-AT'));\n    }\n\n    // Watch the payload and update the title\n    (function(scope) {\n        scope.$watch('msg.payload', function(data) {\n            if (data.match(\"systemsummary\")) { //Systemstatus\n                m = data;\n                n = m.split(':');\n                //alert(n[1]);\n                var sSummary = parseInt(n[1], 10);\n                if(sSummary === 14){\n                    document.getElementById(\"clock\").style.backgroundColor =\"transparent\";\n                }\n                if(sSummary < 14){\n                    document.getElementById(\"clock\").style.backgroundColor =\"#FF0033\";\n                }\n            }else{\n                displayTitle(data);\n            }\n        });\n        setInterval(upTime,1000);\n    })(scope);\n</script>","storeOutMessages":false,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":160,"y":1658,"wires":[[]]},{"id":"bcf31f4d.05939","type":"inject","z":"83afaffb.3b3b8","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"start","payload":"1","payloadType":"num","x":110,"y":1183,"wires":[["d9f00969.4b65f8"]]},{"id":"33aea16c.1ec5be","type":"ui_chart","z":"83afaffb.3b3b8","name":"","group":"31698392.1d898c","order":4,"width":0,"height":0,"label":"chart","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"2","removeOlderPoints":"1000","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":true,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":550,"y":1443,"wires":[[]]},{"id":"5ecc35a3.c4cc0c","type":"debug","z":"83afaffb.3b3b8","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":530,"y":1263,"wires":[]},{"id":"d9f00969.4b65f8","type":"file in","z":"83afaffb.3b3b8","name":"","filename":"realtest.txt","format":"utf8","chunk":false,"sendError":false,"encoding":"none","x":210,"y":1263,"wires":[["78aa41ff.b3d2f","5ecc35a3.c4cc0c","e1f987d3.f065f8"]]},{"id":"78aa41ff.b3d2f","type":"csv","z":"83afaffb.3b3b8","name":"","sep":",","hdrin":true,"hdrout":"","multi":"mult","ret":"\\n","temp":"","skip":"0","strings":true,"include_empty_strings":false,"include_null_values":false,"x":310,"y":1343,"wires":[["c4a5cccc.3b04","5ecc35a3.c4cc0c"]]},{"id":"c4a5cccc.3b04","type":"function","z":"83afaffb.3b3b8","name":"graph generate","func":"\nfunction toTimestamp(strDate){\n     var datum = Date.parse(strDate);\n     return datum/1000;\n    }\nvar payload=msg.payload;\n\n\nvar data_out=[];\nvar a1=[];\nfor(let i=0;i<payload.length;i++)\n{\n  \nvar Data= payload[i].Data.split(\"-\");\nvar t=Data[2]+\"/\"+Data[1]+\"/\"+Data[0];\nvar timestamp=toTimestamp(t+\" \"+payload[i][\"Godzina\"]);\n//var timestamp=toTimestamp(\"Godzina\");\n//console.log(t);\n\n/*\n// Requiring fs module in which\n// writeFile function is defined.const\nfs = require('fs')  \n// Data which will write in a file.\nlet data =\"Learning how to write in a file.\"  \n// Write data in 'Output.txt' .\nfs.writeFile('Output.txt', data, (err) => {      \n// In case of a error throw err.   \nif (err) throw err; })\n\n*/\n\nvar total={ \"x\": timestamp, \"y\":parseInt( payload[i][\"Total\"]) };\n\n\na1.push(total);\n\n/*if (total = 42){\nvar MAX = new Boolean(false);\n}\n */\n \n}\n\ndata_out=[a1];\nmsg.payload=[{\n\"series\": [\"Total\"],\n\"data\":data_out,\n\"labels\": [\"Total\"]\n}];\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":320,"y":1463,"wires":[["5ecc35a3.c4cc0c","33aea16c.1ec5be","4e0aab3b.54ee74"]]},{"id":"e1f987d3.f065f8","type":"function","z":"83afaffb.3b3b8","d":true,"name":"notification function","func":"var payload=msg.payload;\n\n\nfor(let i=0;i<payload.length;i++)\n{\n// var Data= payload[i].Data.split(\"-\");\nvar total= parseInt( payload[i][\"Total\"]);\nmsg.payload=total;\n}\n\n//return msg;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":350,"y":1143,"wires":[[]]},{"id":"9b612191.edbff","type":"ui_toast","z":"83afaffb.3b3b8","position":"top right","displayTime":"3","highlight":"","sendall":true,"outputs":0,"ok":"OK","cancel":"","raw":false,"topic":"","name":"","x":710,"y":1363,"wires":[]},{"id":"f2049ccb.8069d","type":"ui_group","z":"","d":true,"name":"Visitor Count","tab":"36e2a801.ed67a8","order":1,"disp":true,"width":"16","collapse":false},{"id":"754f26ec.f54098","type":"ui_group","z":"","name":"New Message","tab":"","order":1,"disp":true,"width":"6","collapse":false},{"id":"e56f5108.01102","type":"ui_group","z":"","name":"LiveVideo","tab":"","order":1,"disp":false,"width":"35","collapse":false},{"id":"31698392.1d898c","type":"ui_group","z":"","name":"","tab":"36e2a801.ed67a8","order":2,"disp":true,"width":"16","collapse":false},{"id":"36e2a801.ed67a8","type":"ui_tab","z":"","name":"Welcome to SHOP ANALYTICS","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Please don't ask the same question twice (Chart timestamp on x-axis not accurate). I am closing this one to avoid confusion. If the information you gave on the first one is no longer correct then comment further on that thread.