03-28-2012 06:54 AM
Hello:
I use a "write to spreadsheet file" function to write a 2D array. Can I put new values on the top of spreadsheet file, and the older values go down, namely, the last value is always on the top of the spreadsheet file?
Thank you.
03-28-2012 07:00 AM - edited 03-28-2012 07:00 AM
Hi,
Check the attached VI. I think this is something what you are trying to do.
Regards,
Nitz
(Give Kudos to Good Answers, Mark it as a Solution if your problem is Solved)
03-28-2012 07:20 AM
Are you continously writing the data to the spread sheet?. Yes you can add but how you are doing that can you post the snippet of your code.
03-28-2012 07:38 AM
Thanks for you response, NitzZ, but my problem is that data arrives dinamically. I want that the last value that arrives, was on the top because it will be a big list.
I attach the snipet vi.
03-28-2012 08:15 AM
No, you can't.
File systems write data sequentially to a file. So new data being appended to a file can only go to the end of the file. It can't put data at the beginning of the file unless you read the whole file in, append the new data to the beginning of the string in RAM, then write all the data back out to the file again overwriting the old file.
03-28-2012 08:45 AM
Oh, no! It's more difficult than I thought.
And using a listbox, is it possible? Then, I can save it in the spreedsheet file, isn't it?
03-28-2012 08:51 AM
Hi damos,
a listbox is an indicator for the front panel. So how can that indicator help you in writing text to a spreadsheet file?
You cannot write data to the beginning of a file without overwriting older data.
You can, however, read in the whole file, attach new data at start and write the file again (as said before)...