LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Exporting data from clusters into a format Excel can read

Hi,

I have a subVI that processes raw data from a DAQ and outputs PSD and FFT data in the form of two clusters of 3 elements - two DBLs and a 1-D array of DBL. I want to export this data into 2 separate spreadsheets that can be read by Excel, but I'm having trouble. I can't just wire a cluster to the "Write to Spreadsheet File" VI. I've unbundled the cluster, but I don't know where to go from there, or even whether that is the right thing to try.

Your help would be greatly appreciated.

Dominic
0 Kudos
Message 1 of 2
(3,654 Views)
You will have to build the spreadsheet string line by line; decide what you want in each cell, extract the cell data from the cluster, convert it to a string (number to string functions etc..) and concatinate it with the data for the next cell, but with formatting characters in between (e.g. tab to separate each element on the same row (i.e. columns) and carriage return line feed to separate rows..

You can either build the entire spreadsheet in memory and then write it to disk using e.g. write characters...or you can open/create a file first and write one line at a time with the write function and then close it afterwards (use the basic file io functions so that the file is not opened and closed for each iteration, that makes it very slow).

I have attached a
small example.
0 Kudos
Message 2 of 2
(3,654 Views)