How Can I Import Spreadsheet Files into LabVIEW Using the CSV Format?
Primary Software Version: 8.2
Primary Software Fixed Version: N/A
Secondary Software: N/A
I have a Microsoft Excel spreadsheet that I would like to import into LabVIEW, but I do not want to use ActiveX calls to read the data. Is there any other way to read this type of file?
A common method of reading spreadsheet data into LabVIEW is with the Read Delimited Spreadsheet VI. This VI can read any type of spreadsheet as long as the file delimiter is known. A delimiter is a sequence of one or more characters used to specify the boundary between cells in the spreadsheet file. One good example of a delimiter is the comma character, which acts as a field delimiter for a comma-separated value file.
Microsoft Excel has a built in feature to save a spreadsheet as .csv file type. This file type saves the raw data in a text file separated by the comma character. LabVIEW can then read this file type with the Read Delimited Spreadsheet VI and import your data.
Below is the process for saving a spreadsheet in Excel as a .csv file and importing it into LabVIEW.
Note: Two caveats to using the .csv file format are that it does not support multiple sheets and some Excel features are not compatible. Excel will display two warnings about these limitations when you save the file.
Note: The Read Delimited Spreadsheet sub-VI contains a significant amount of functionality. Refer to the Context Help for more information about the various inputs and outputs.
To use the Excel file (instead of a CSV file) directly in LabVIEW, the Report Generation Toolkit is required. As of LabVIEW 2014, this toolkit is now included with LabVIEW Professional. Please see the product page for more information: Products and Services: NI LabVIEW Report Generation Toolkit for Microsoft Office
Note: In LabVIEW 2014 SP1 and earlier, this functionality was encapsulated in the Read From Spreadsheet VI, which has been deprecated in LabVIEW 2015 and newer.
KnowledgeBase 4CSI7PQ7: Reading Microsoft Excel Numeric Data Into LabVIEW
Products and Services: NI LabVIEW Report Generation Toolkit for Microsoft Office
Read from CSV.vi
Report Date: 02/11/2009
Last Updated: 01/04/2016
Document ID: 4UAB2OLF