LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Creating a header for a .CSV file

Solved!
Go to solution

Hi,

 

I have looked through the forums and cannot find a solution for creating a header for a csv file.  I am using Labview 8.2.  I want a label for each column at the top of the file and then I will append new rows to the file as the data is collected.  An example of what I am looking for is attached.

 

It would also be nice to have the labels descending in the first column, pretty much a transposed version of what was described above. 

 

Thanks,

Gary 

0 Kudos
Message 1 of 6
(9,863 Views)
Solution
Accepted by topic author glstill
Simply call the Write To Spreadsheet File twice. The first time you wire in a 1D array of strings which is your column headers. Then, you call it when you're writing out your data. Make sure you wire a True constant to the "append" input for that function.
Message 2 of 6
(9,862 Views)

Thank you very much.  That worked well. 

 

If i wanted to transpose the data how would I do that?  I can get the header to be vertical, but I cant get the data to append to the 2nd column , and then the third and so on with the data descending from top to bottom.  I attached an example of what I might want the file to look like. Each column would be added one at a time.

0 Kudos
Message 3 of 6
(9,849 Views)
Errr.. I'm a tad confused now. Which format are you looking for? Columnar (first example, and the most common) or row (second example)?
0 Kudos
Message 4 of 6
(9,845 Views)
I am now trying to figure out how to do the second example.  I'm not sure what I will need yet, so I'm exploring how to create files both ways.
0 Kudos
Message 5 of 6
(9,798 Views)
If you want the row method then you obviously need to insert your header column into your 2D array of data prior to writing it out. This method would use only 1 Write to SpreadSheet File function.
Message 6 of 6
(9,793 Views)