Example Code

Clipboard (Copy & Paste from Excel / CSV) to 2D Double Array with Headings

Code and Documents

Attachment

Overview
This example VI converts comma or tab delimited data from the clipboard (copied from Excel or a CSV file opened in notepad) into a 2D array of numeric data.

 


Description
This example VI provides a way to read data from CSV files into your processing Vis. With this VI you can logged experimental data into a .CSV (Comma Seperated Values) file on the PC firstly, and then processed it in another VI. All the data from the CSV files will be read into a 2D array of numeric data. Anyone that uses LabVIEW for research or processing experimental data that stored in a spreadsheet may find that this can save a lot of time trying to figure out how to get data from Excel into LabVIEW quickly and easily.

This VI is designed base on the 3 articles on the knowledgebase below.

There two controllers on the front panel, the "Header Row Button" decide whether removed the first row and the "TAB Delimited Button" will be click when the file is a CSV/Tab-delimited file rather than a CSV file.

 


Requirements

  • LabVIEW 2012 (or compatible)


Steps to Implement or Execute Code

  1. Unzip the attached folder to your computer
  2. Open the VI "Clipboard to Numeric Array 2012 NIVerified.vi"
  3. Chose the state of "Header Row Button" and "TAB Delimited Button"
  4. Run the program

 

Additional Information or References
VI Block Diagram

 Block Diagram.png

 

 **This document has been updated to meet the current required format for the NI Code Exchange.**

 

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
peterbaum
Member
Member
on

awesome, thanks!