Read csv file dynamically


I am able to read CSV file, but my problem is that after few times new CSV file is generated in the same folder with name VT3_CUP_xxxx_0001.csv. So Everytime I have to read newly generated CSV.My question is How I read the newly generated CSV file automatically.

here xxxx in file name is timestamp of when CSV is generated.csv is generated by another system

Have a look at the "watch" node.

1 Like

You could use a Watch node, which is one of the built-in nodes, to tell you that the new file is available for reading.

1 Like

At a guess, you process the file then move it or rename it?

You could simply use node-red-contrib-fs-ops to scan the dir, get a list of outstanding *.csv files, process them 1 at a time, then move/rename them.

You can use the watch or simply do a dir listing once per minute (or so) - if CSV files exist, then you have more to process.

One thing to you may need to be mindful of is reading a file that is being written.

1 Like

As you said I install node-red-contrib-fs-ops, but I am confused how to use that. Have you some sample flow?

Plenty here

And here

1 Like

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