Reading from Text Files

Complete the following steps to read from a text file.

  1. Write to the text file.
  2. Select a string indicator on the Controls»String & Path palette and place it on the front panel.
  3. Select the Read Characters From File VI on the Functions»File I/O palette and place it on the block diagram.
  4. Right-click the file path input of the Read Characters From File VI and select Create»Constant from the shortcut menu. An empty path constant appears.
  5. Enter the path of the text file you want to read from in the file path constant.
  6. Wire the string indicator to the character string output of the Read Characters From File VI.
  7. Run the VI. The VI reads the text from file wired to the file path input and displays the text in the front panel string indicator.

Refer to the Read from Text File VI in the examples\file\smplfile.llb for an example that reads and plots data previously stored with the Write to Text File VI example.