Table Of Contents

Read from Text File (G Dataflow)

Last Modified: January 9, 2017

Reads a specified number of bytes from a byte stream file.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

Programming Patterns
connector_pane_image
datatype_icon

prompt

Custom message in the title bar of the file dialog box that appears when you do not wire a value to file path.

datatype_icon

file path

The file that this node reads.

This input can be a reference to a file or an absolute file path. The node opens the specified file without requiring you to call Open/Create/Replace File first.

If you specify an empty path, a relative path, or a path to a non-existent file, this node returns an error.

Default: No value — Displays a file dialog box that prompts you to select a file.

datatype_icon

count

The maximum number of bytes the function reads.

This node reads fewer bytes if it reaches the end of file first. If count is <0, the function reads the entire file, unless the number of bytes is too large to be represented by a 32-bit integer. In such a case, this node returns an error.

spd-note-note
Note  

Strings are encoded in UTF-8. In most cases, the number of bytes in a string is equivalent to the number of characters. However, for strings containing the characters U+0080 through U+7FFFFFFF, the number of bytes is greater than the number of characters.

Default: The total number of bytes in the file.

datatype_icon

error in

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

Default: No error

datatype_icon

refnum out

A reference to the file that this node uses.

datatype_icon

text

The string read from the file.

datatype_icon

cancelled?

A Boolean value that indicates whether the user cancelled the dialog box that appears if no input file was wired to this node.

True The dialog box was cancelled.
False The dialog box was not cancelled, or the dialog box did not appear.

Default: False

datatype_icon

error out

Error information. The node produces this output according to standard error behavior.

Where This Node Can Run:

Desktop OS: Windows

FPGA: All devices (only within an Optimized FPGA VI)


Recently Viewed Topics