I am attempting to add header information once to a .csv file that is continuously updated. Following an online example, I am able to add the header information, but I only get one row of data, which I suspect is due to the first "write to file" command not having a true append status. Adding that true append status then adds the header to every line of data. Currently I have added a case statement that I was hoping would check if a timer had reached a certain limit and append the header data if the timer value was below a certain threshold, or skip the header if the timer was exceeded. Despite changing the value of the timer condition, the results in the file indicate that the case statement always evaluates as false. I initially has the timer threshold value as 2 ms, but even with a value of 10 seconds the results are unchanged. I would be very appreciative of any help to solve this issue.
What I have:
What I would like:
Because the file is added to constantly, I would like to avoid a solution that involves reading the file constantly and checking if there is data contained within.
Thank you very much for your time.
Solved! Go to Solution.
I can't open you code because I only have LV2016 here but...
In general you do this:
Thank you very much! I'm dissapointed I didn't try that earlier. I pulled the header writing portion out of the external case statement, but not outside of the overriding while loop. Based on your suggestion, I pulled the header portion all the way out and it worked.