Timestamp in filename

699 views
Skip to first unread message

kartheek koka

unread,
May 10, 2017, 5:55:47 PM5/10/17
to Node-RED
Hi, I want to create a file with name "example mmddyyyy hh:mm:ss.csv" every 5 mins with data from msg.payload in it. So, "example" remains and every 5 mins, the timestamp changes creating a new file. As of now, I am using the "file' node which which I cannot change the file name. Can anyone help if they already achieved this.

Zenofmud

unread,
May 10, 2017, 6:07:41 PM5/10/17
to node...@googlegroups.com
Why can’t you change the filename? According to the Info tab

Writes msg.payload to the file specified, for example to create a log.

The filename can be configured in the node. If left blank it should be set by msg.filename on the incoming message.

A newline is added to every message. But this can be turned off if required, for example, to allow binary files to be written.

The default behaviour is to append to the file. This can be changed to overwrite the file each time, for example if you want to output a "static" web page or report.

This node can also be configured to delete a file if required.



On May 10, 2017, at 5:55 PM, kartheek koka <karthe...@gmail.com> wrote:

Hi, I want to create a file with name "example mmddyyyy hh:mm:ss.csv" every 5 mins with data from msg.payload in it. So, "example" remains and every 5 mins, the timestamp changes creating a new file. As of now, I am using the "file' node which which I cannot change the file name. Can anyone help if they already achieved this.

--
http://nodered.org
 
Join us on Slack to continue the conversation: http://nodered.org/slack
---
You received this message because you are subscribed to the Google Groups "Node-RED" group.
To unsubscribe from this group and stop receiving emails from it, send an email to node-red+u...@googlegroups.com.
To post to this group, send email to node...@googlegroups.com.
Visit this group at https://groups.google.com/group/node-red.
To view this discussion on the web, visit https://groups.google.com/d/msgid/node-red/e4117a62-f233-4f90-9baa-c18a333f386b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mike Bell

unread,
May 10, 2017, 6:31:13 PM5/10/17
to Node-RED
Actually, if you leave the file name blank when you configure the file node, you can set the file name with msg.filename in the incoming message. (See the node info.)
Reply all
Reply to author
Forward
0 new messages