LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add single value along with data to spreadsheet file

Hello,

 

I am saving a 2D data to a spreadsheet file (2 columns of values), how can I save one single extra value to the file (I tried 1 element 3rd column but wasn't successful). The single value is result calculated from the large data. Idk if my task is as specific but couldn't find any clues.

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

Hi Adalbertus,

 

save that additional value in an additional column...

 

When you have peproble with your VI then you should attach it!

Best regards,
GerdW


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

There is no VI I have problem with, as I have a big VI, needless to post (if I post it I will get response to a bazilion things I didn't ask), where the 2D part of saving works, I want to add the functionality to add the single value. Currently I am using save to spreadsheet to save the two columns. that works. I don't know how to attach single element to a block that expects array. Maybe I should build 1 element array but then the dimensions doesn't fit.

0 Kudos
Message 3 of 7
(2,079 Views)

Ok appending with second "save to ss" works, now I only need to make it append as 3rd column.

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

You do know that a "Spreadsheet file" is just a text file, don't you?  So you could simply read it as a Text file (say, line-by-line) and write it out with another name (at least while testing, so you don't "destroy your data" while your testing your ideas).  If you do this, can you figure out how to add a single value (a) at the beginning of the file, or (b) at the end of the file?  [This is really a very simple question -- don't "overthink" it].

 

Bob Schor

 

P.S. -- a Text file means that the data in the file consist of strings, usually separated by "line-terminator characters", most typically the character pair <CR><LF> (Carriage Return, hex D, and Line Feed, hex A).  Check out how Read from Text File works.  I'll note that the Help documentation is unclear about how to turn on and off "Read Lines" -- right-click the function on the Block Diagram and click "Read Lines" from the Drop Down to change the function.

0 Kudos
Message 5 of 7
(2,075 Views)

So, two blocks of "save to SS file" solved it, first saves 3 arrays of 1 element (dummy header for data columns and a single value as third), then the second one appends transposed data. Was simple I just didn't want to trial and error at 23 pm...

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

If you write the result table with one "write delimited file", you can add data with the input "Append to file", else it'll restart and will only result in the last line written as the only one.

/Y

G# - Award winning reference based OOP for LV, for free! - Qestit VIPM GitHub

Qestit Systems
Certified-LabVIEW-Developer
0 Kudos
Message 7 of 7
(2,044 Views)