Example Code

Read from Spreadsheet In Chunks in LabVIEW

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

This code allows the user to read a specified amount of lines from a Spreadsheet File at a time.
LabVIEW doesn't have to read in the entire document each time, but rather "x" Number of Lines at a time.

 

Description

Read from <text File VI with Read Line property set outputs the values of the specified .txt in the Number of Lines. For loop with the Concatenate function converts a 1D Array of lines into one long string and Finally the Spreadsheet String To Array function converts one "spreadsheet" string into a 2D Array of strings. It is parsed by default as tab delimited and line return between rows.

 

Requirements

LabVIEW 2012 (or compatible)

 

Steps to Implement or Execute Code

  1. Type the Number of Lines in that control
  2. Run VI
  3. Provide a .txt file location when prompted
  4. Spreadsheet information Array Indicator shows the values of the specified .txt in the Number of Lines
  5. Final 2D Array loads the values from Spreadsheet information Array Indicator in case there is a spaces between values in the same line

Additional Information or References

3744.png 

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

Jonah Paul
Marketing Manager, NI Software

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

Comments
HunterSeeker
Member
Member
on

Could you please add a screenshot of your block diagram and/or front panel.

Thanks

Todd S.
NI Employee (retired)
on

Thanks for posting!

Todd S.
LabVIEW Community Manager
National Instruments