06-02-2011 07:33 AM
I'm continuosly writing data to 2 columns of a spreadsheet file in a consumer loop. I would like headings (string format) at the top of the spreadsheet. I've attached a snippet of my code showing what I'm doing currently... I want these headings to be written to the file once and write the data to the same file under the relevant headings. However, currently my headings are being wrote to the file on every loop iteration instead of just writing once.
I've tried a few different variations of my attached snippet of code including combining the data and heading into one array and using one write to spreadsheet vi but a similiar output occurs
I've looked at previous threads highlighting similiar problems but found nothing that helped me with my problem
Strokes
Solved! Go to Solution.
06-02-2011 07:35 AM
Post your actual code and I will give you a hand.
06-02-2011 07:43 AM
Move the header write outside of the loop or put it in a case statement that writes it only on the first iteration using the loop counter.
06-02-2011 08:13 AM
@aeastet wrote:
Post your actual code and I will give you a hand.
Ernie H's solution is just what I was after, it's working as required now.
Didn't think there was much point in posting the code as there's quite a bit of it and the snapshot I provided was the only part of the code that was relevant to my question.
However, I will only post code in future if it's the prefered method of looking for help.
Thanks,
Strokes
06-02-2011 08:15 AM
Doing this efficiently and easily will require what looks like a lot more code, but in reality will be less. Start with opening up the write to spreadsheet file and looking at how it works. You can do a simplified version of this. Try the following:
Good luck. If you have any further questions, let us know.