Hello. I am using a file node to save data that I receive into NR every 5 seconds. The data is in json format so the first thing I do is save "[" in the file, then the data arrives every 5 seconds (from an exec node) and I save a "," after the exec node so that the format is
[message1, message2, message3,
To close this (at the end of every day) I use a function node to check if the date has changed. If the date has changed (a new day has started), I want to end the file with
My problem is that I have a comma after the previous message.
Is there anyway to replace the last comma with a "]" if the new day has been started? Or to delete the last character of a file?
Thanks in advance.