Generating and appending to an XML or text file???

My experience with using XML and text files in Vuo up to this point has only been to read them. Now I have a project that requires me to write and append to an XML or text file. I have been looking at Format Table and Make Tree nodes but they don’t see how they would allow you to add to an existing file. Basically we have an event that’s about 1-2hrs long where I need to create a VUO composition that every 20-30 seconds appended a few strings of generated text to a file (Name, Program and Time-Stamp). Can Vuo do this? It seems risky to have to reload the file and add to it and re-save back to the same file every 20-30 seconds. I would be in a mess if the file became corrupted.

Any ideas how to safely accomplish this?

Vuo doesn’t have an option to append to a file, only create a new file or overwrite an existing file (Save Data node). Since you’re nervous about overwriting, what you could do is save each table row to a separate file whose name is the timestamp, then after the event use cat on the command line to combine the files.

Thanks for the suggestion Jaymie, I’ll give it a try!

Would it possible to add an “Append” to file option to the Save Data node? Maybe where the Overwrite URL True/False switch option is instead make it an Overwrite/Don’t Overwrite/Append switch or something?

Jaymie, thanks! This is the direction I went for now using the command line and it works well. I’ll probably try and make an AppleScript app to make it easier for others to do this step until append is supported natively in Vuo. Thanks again!

1 Like

I also want to append data to a file … the approach above won’t be sensible because I want to write much more frequently. Seems like a fairly obvious omission?

Added the ability to append to a file in the Save Data node. Implemented in Vuo 2.0 beta.

Yes!!! Thank you!