LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

order in write to spreadsheet file

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.

0 Kudos
Message 1 of 7
(2,515 Views)

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:smileywink:)

0 Kudos
Message 2 of 7
(2,514 Views)

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.

-----

The best solution is the one you find it by yourself
0 Kudos
Message 3 of 7
(2,509 Views)

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.

0 Kudos
Message 4 of 7
(2,505 Views)

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.

Message 5 of 7
(2,497 Views)

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?

0 Kudos
Message 6 of 7
(2,487 Views)

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)...

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 7 of 7
(2,482 Views)