Hii Guys
I would like to read the datalog of my machine. The datalog is using CSV and I just want to read the last line.
Im facing some problem to do that.
-
My datalog filename is changing over weeks. By example it now is week 23 2018 the filename is “Log1823” file name is changing over time.
-
I would like to check my latest line using fastCSV. and i still try to explore it.
My code as follows :
[{"id":"9e324255.c4cc3","type":"fastcsv","z":"9e7f522.6e5d5b","name":"fastcsv","headers":true,"headerstr":"","ignoreEmpty":true,"discardUnmappedColumns":true,"strictColumnHandling":false,"delimiter":",","quote":"\"","escape":"\"","comment":"#","ltrim":false,"rtrim":false,"rowDelimiter":"\\n","includeEndRowDelimiter":false,"quoteHeaders":false,"quoteColumns":false,"x":780,"y":240,"wires":[[]]},{"id":"4ff34b14.fbd8a4","type":"inject","z":"9e7f522.6e5d5b","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":220,"wires":[["a9e0d871.9c4be8"]]},{"id":"6f6ec532.c1b0ec","type":"file in","z":"9e7f522.6e5d5b","name":"","filename":"","format":"utf8","chunk":false,"sendError":false,"x":510,"y":280,"wires":[["9e324255.c4cc3","d330cc78.0c9b"]]},{"id":"a9e0d871.9c4be8","type":"function","z":"9e7f522.6e5d5b","name":"FilenameCoordinator","func":"msg.payload = \"D:\\log_rotary_common_tester_1743.csv\"\nreturn msg;","outputs":1,"noerr":0,"x":330,"y":140,"wires":[["cb25d4d1.cbbe98"]]},{"id":"d330cc78.0c9b","type":"debug","z":"9e7f522.6e5d5b","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":740,"y":140,"wires":[]},{"id":"cb25d4d1.cbbe98","type":"change","z":"9e7f522.6e5d5b","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"filename","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":300,"y":300,"wires":[["6f6ec532.c1b0ec"]]}]
Thanks in advance
Really appreciate your kind help to fix my problem.