Search code examples
node-red

node-red read in multiple files


I'm migrating forms data from one system to another and I need to process some saved HTML files. I need to extract the content from those forms into text files to preserve the data.

Using node-red I can read the directory containing the forms and extract the file names. With a single file, using the File In node I can read the data into an HTML node and extract the elements I need to.

What I can't do is pass multiple filenames to the File In node. Does anyone know how the parameterise the 'Filename' field in the File In node, or of a different module that would accept streamed input?

Thanks.


Solution

  • The info panel for the File In node shows that you can set the filename by passing it in to the node as msg.filename - as long as you leave the filename field blank in the node's configuration.

    So rather than try to pass one message to the node with multiple files names, you should pass one message per filename to the node.