LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

writing to excel file

new to labview, i am having teething pains. i can write data to an excel file but can not figure how to label the columns nor get the data to populate the columns instead of one continuous string in excel.
0 Kudos
Message 1 of 2
(2,781 Views)
rwarrender,

The attached vi is cut from a larger program. It writes a couple lines of header information above columns of data. You can't do this in a less elegent manner, but it will get you started.

The header info varies: some comes from string controls (reflecting user input of test conditions), some reproduce parameters of the VI itself as a record of test conditions (I wired in a constant in place for the real parameter), there is an array constant wired in in place of the real data.

A boolean control enables the writing of the spreadsheet.

The rows of header info are written into the file in 3 separate Write Characters to File operations. The writes are set to append so they are written as consecutive rows (sequenced
by the Task ID wire). Finally the array of datais written below the header(append set to TRUE). The problem with your data looking like a string is probably just that it needs to be transposed before writing to the file. If it is in columnar form before it is wired into the Write to preadsheet File, then it will be in columnar form in the spreadsheet file.

The file is written as tab delimited (the default). You can change this - look at the help on Write to Spreadsheet File.

Mike
0 Kudos
Message 2 of 2
(2,782 Views)