Hoyer Posted July 26, 2020 Share Posted July 26, 2020 Hi, I would like to write data into a txt file every time a given event occurs, which I would like to investigate later. So I want new data to be written into the same txt file, into a new row without overwriting previous data. How can I do that? Thank you in advance! Quote Link to comment Share on other sites More sharing options...
AzeoTech Posted July 27, 2020 Share Posted July 27, 2020 You could use an export set, or if you want real control over the file format, use the low level file functions. For example: private handle = file.open("c:\data\myfile.txt",0,1,1,1) file.write(handle, "Here is some data:" + myChannel[0]) file.close(handle) The Logging part of the user's guide has the description of all the file. functions. Those 0's and 1's in open correspond to: Read, Write, Append, Text, so what I have in the example is not to read, but to write; to append and not overwrite data, and that I'm writing a text file (which means it generates a new line with every call to write()) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.