LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to programatically create a type def. from the column header

I write numerous post-processing software to analyze the output files from different measurement systems which typically output ASCII files. Generally I create a type def. with all the columns of data I am interested in processing and then assign the appropriate column/row of data to the correct cluster element using bundle by name (as shown in the example:CSV Header to type def).

My question is: can I programatically create a type def. from the column header? Or is there a better way to get the data into a cluster where I can use the 'un-bundle' and 'bundle by name' in my programming? This would save me endless time and allow me to write software where I don't know the arrangement of the files.

0 Kudos
Message 1 of 2
(2,197 Views)

Yes, it is possible to create a TypeDef from an Excel WorkSheet (or from a multi-WorkSheet WorkBook).  It involves creating what I would call a "Master WorkBook" that contains the WorkSheet(s) that you plan to use, with both Header information and "sample data" that you can use to determine the appropriate DataType.  Note that this involves LabVIEW Scripting -- you basically write a LabVIEW routine that analyzes the Master WorkBook and, using Scripting, builds the TypeDef (or TypeDefs) that you then use in the (separate) LabVIEW processing routines that analyze "real" WorkBooks that comform to the format of the Master WorkBook.

 

Bob Schor

0 Kudos
Message 2 of 2
(2,173 Views)