Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Reading from Text Files

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info
Download Help (Windows Only)

Complete the following steps to read characters or strings from a text file.

  1. Add a string indicator to the front panel.
  2. Add the Read from Text File function to the block diagram.
  3. Right-click the file input of the Read from Text File function and select Create»Constant. A path constant appears. Enter an absolute path for the file you wish to read from into the constant.
Tip  To avoid typing out the path, you can drag a file from the desktop and drop it into the constant.
  1. Wire the text output of the Read from Text File function to the string indicator.
  2. Run the VI. The VI reads the text from the file you specified in the constant and displays the text in the front panel string indicator.

Refer to the Read from Text File VI in the labview\examples\file\smplfile.llb for an example that reads data from a text file and plots the data.


Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit