LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Help adding string header (two lines) to a 2D array.

Hi there compadres! My labview program spits out a 5 column 2d array
and saves it to disk. before it saves, i would like the program to add
2 lines of strings into the file. Is there a way to accomplish this.
0 Kudos
Message 1 of 5
(7,545 Views)
If I understand, you want to add two rows to the top of the array, yes? All you have to do is use the insert into array function. See attached...

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(7,545 Views)
all right, i found out the answer to this myself. essentially what you
need to do is write the two line header as strings separated by a hard
return into a file using write to file.vi then take the path to
another vi called write to spreadsheet. there is an option available
for appending, and you have to add a boolean that says yes. This
should do the trick. Roshan Shrestha
Message 3 of 5
(7,545 Views)
This works, but you can also perform this by converting the array into a spreadsheet string, concatenating this with the header string, and then write the string file. I have used this method and found it to work quite well. It works for inserting both full lines of text or for inserting column headings. If you insert column headings make sure that the delimiters are the same as the data if you want to import the data into some other software.

John
Message 4 of 5
(7,545 Views)
I am assuming that this is a current post and the dates are just wrong. The simplest way to do this is to use the array to spreadsheet string function and then add the two header lines to the text file. I have attached an example.

Hope this helps.
0 Kudos
Message 5 of 5
(7,545 Views)