Reading Data from local files

Hi everyone,
i am new to node-red and have nothing to do with programming. I just like doing things myself.
I made a flow that is doing exactly what i want and posts some data to emoncms.
Here is the flow.

[{"id":"573a2a3c.50f604","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"1bf05f39.4a20c1","type":"inject","z":"573a2a3c.50f604","name":"","topic":"","payload":"","payloadType":"date","repeat":"840","crontab":"","once":false,"onceDelay":"0.1","x":130,"y":180,"wires":[["8b06b748.845cf8"]]},{"id":"8b06b748.845cf8","type":"file in","z":"573a2a3c.50f604","name":"msg.filename","filename":"/home/emonadmin/test/test1.txt","format":"lines","chunk":false,"sendError":false,"encoding":"utf8","x":250,"y":240,"wires":[["60e7d4f5.91541c"]]},{"id":"60e7d4f5.91541c","type":"function","z":"573a2a3c.50f604","name":"Parse data","func":"let parsed = {} \nlet p = msg.payload\nparsed.parts = p.split(\"\");\nparsed.data = p;\n//parsed.datalength = parseInt(parsed.parts[1],16);\nparsed.Date = parseInt(parsed.parts[0] + parsed.parts[1] + parsed.parts[2] + parsed.parts[3] + parsed.parts[4] + parsed.parts[5]+ parsed.parts[6] + parsed.parts[7],10);\nparsed.Time = parseInt(parsed.parts[8] + parsed.parts[9] + parsed.parts[10] + parsed.parts[11] + parsed.parts[12] + parsed.parts[13],10);\nparsed.Type = parseInt(parsed.parts[14] + parsed.parts[15],10);\nparsed.id = parseInt(parsed.parts[16] + parsed.parts[17] + parsed.parts[18] + parsed.parts[19] + parsed.parts[20] + parsed.parts[21],16);\nparsed.BatteryStatus = parseInt(parsed.parts[22] + parsed.parts[23],16);\nparsed.PulseCount = parseInt(parsed.parts[24] + parsed.parts[25] + parsed.parts[26] + parsed.parts[27] + parsed.parts[28] + parsed.parts[29],16);\nparsed.SignalLvl = parseInt(parsed.parts[30] + parsed.parts[31],16);\nparsed.CheckCode = parseInt(parsed.parts[32] + parsed.parts[33] + parsed.parts[34] + parsed.parts[35],16);\n\n\nmsg.payload = {Μέτρηση:parsed.PulseCount};\nmsg.nodegroup = parsed.id;\n//msg.payload.parsed.Date\n//return msg;\nnode.send(msg);\n","outputs":1,"noerr":0,"x":390,"y":180,"wires":[["153243d4.33893c","7694b9af.381038"]]},{"id":"153243d4.33893c","type":"debug","z":"573a2a3c.50f604","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":550,"y":220,"wires":[]},{"id":"b1443795.f8b0a8","type":"emoncms","z":"573a2a3c.50f604","name":"Emoncms Push","emonServer":"565f590f.ecd6a8","nodegroup":"","datatype":"fulljson","x":780,"y":120,"wires":[]},{"id":"7694b9af.381038","type":"delay","z":"573a2a3c.50f604","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":140,"wires":[["b1443795.f8b0a8"]]},{"id":"565f590f.ecd6a8","type":"emoncms-server","z":"","server":"http://192.168.0.152/emoncms","name":"EmonServer"}]

What i want to do and don't know how, is that in the folder i have the file that i currently read the data from, there will be created a new one every hour and i would like to read that one next and after that the next one and so on. How i could accomplish that?
Thank you in advance.

take a look at the watch node

Do the filenames include the date and hour?

If so
Set the inject node to inject just past each hour.
In a function you can determine the the date and time and create the filename, send that to the file node you are using as msg.filename

Thanks for the replies. I tried with watch node but i get the error below.
Error: EISDIR: illegal operation on a directory, read.
This is my flow

[{"id":"573a2a3c.50f604","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"8b06b748.845cf8","type":"file in","z":"573a2a3c.50f604","name":"msg.filename","filename":"/home/emonadmin/test/","format":"lines","chunk":false,"sendError":false,"encoding":"utf8","x":390,"y":280,"wires":[["60e7d4f5.91541c"]]},{"id":"60e7d4f5.91541c","type":"function","z":"573a2a3c.50f604","name":"Parse data","func":"let parsed = {} \nlet p = msg.payload\nparsed.parts = p.split(\"\");\nparsed.data = p;\n//parsed.datalength = parseInt(parsed.parts[1],16);\nparsed.Date = parseInt(parsed.parts[0] + parsed.parts[1] + parsed.parts[2] + parsed.parts[3] + parsed.parts[4] + parsed.parts[5]+ parsed.parts[6] + parsed.parts[7],10);\nparsed.Time = parseInt(parsed.parts[8] + parsed.parts[9] + parsed.parts[10] + parsed.parts[11] + parsed.parts[12] + parsed.parts[13],10);\nparsed.Type = parseInt(parsed.parts[14] + parsed.parts[15],10);\nparsed.id = parseInt(parsed.parts[16] + parsed.parts[17] + parsed.parts[18] + parsed.parts[19] + parsed.parts[20] + parsed.parts[21],16);\nparsed.BatteryStatus = parseInt(parsed.parts[22] + parsed.parts[23],16);\nparsed.PulseCount = parseInt(parsed.parts[24] + parsed.parts[25] + parsed.parts[26] + parsed.parts[27] + parsed.parts[28] + parsed.parts[29],16);\nparsed.SignalLvl = parseInt(parsed.parts[30] + parsed.parts[31],16);\nparsed.CheckCode = parseInt(parsed.parts[32] + parsed.parts[33] + parsed.parts[34] + parsed.parts[35],16);\n\n\nmsg.payload = {Μέτρηση:parsed.PulseCount};\nmsg.nodegroup = parsed.id;\n//msg.payload.parsed.Date\n//return msg;\nnode.send(msg);\n","outputs":1,"noerr":0,"x":390,"y":220,"wires":[["153243d4.33893c","7694b9af.381038"]]},{"id":"153243d4.33893c","type":"debug","z":"573a2a3c.50f604","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":670,"y":240,"wires":[]},{"id":"b1443795.f8b0a8","type":"emoncms","z":"573a2a3c.50f604","name":"Emoncms Push","emonServer":"565f590f.ecd6a8","nodegroup":"","datatype":"fulljson","x":780,"y":120,"wires":[]},{"id":"7694b9af.381038","type":"delay","z":"573a2a3c.50f604","name":"","pauseType":"rate","timeout":"2","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":570,"y":140,"wires":[["b1443795.f8b0a8"]]},{"id":"51568d40.303f24","type":"change","z":"573a2a3c.50f604","name":"","rules":[{"t":"set","p":"filename","pt":"msg","to":"msg.payload.filePath","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":210,"y":360,"wires":[["8b06b748.845cf8"]]},{"id":"c6f6471c.d2ca48","type":"wfwatch","z":"573a2a3c.50f604","folder":"/home/emonadmin/test","x":120,"y":220,"wires":[["51568d40.303f24"]]},{"id":"565f590f.ecd6a8","type":"emoncms-server","z":"","server":"http://192.168.0.152/emoncms","name":"EmonServer"}]

and my installation is on Ubuntu 19.04.
Thank you once more

You aren't using the watch node that came pre-installed in Node-RED ( below the file node in the node list on the left hand side.

Thanks that did it!!!
Thank you once more.