Table Of Contents

Write to Text File (G Dataflow)

Version:
    Last Modified: April 3, 2017

    Writes a string or an array of strings as lines to a file.

    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 the input path.

    datatype_icon

    file path

    The file to which you want to write data.

    This input can be a reference to a file or an absolute file path. In both cases, the node creates the specified file if it does not already exist. The node opens the specified file without requiring you to call Open/Create/Replace File first.

    datatype_icon

    text

    String or array of strings that this node writes to a file.

    datatype_icon

    error in

    Error conditions that occur before this node runs.

    The node responds to this input according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Default: No error

    datatype_icon

    refnum out

    A reference to the file that this node uses.

    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.
    datatype_icon

    error out

    Error information.

    The node produces this output according to standard error behavior.

    Standard Error Behavior

    Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.

    error in does not contain an error error in contains an error
    If no error occurred before the node runs, the node begins execution normally.

    If no error occurs while the node runs, it returns no error. If an error does occur while the node runs, it returns that error information as error out.

    If an error occurred before the node runs, the node does not execute. Instead, it returns the error in value as error out.

    Adding End-of-Line Characters to an Array

    This node appends platform-dependent, end-of-line (EOL) characters to the elements of an array even if you right-click the function and remove the checkmark next to the Convert EOL shortcut menu item.

    Where Does This Node Start Writing?

    If you wire a path to this node, the node opens or creates the file before writing to it and replaces any previous file contents. If you wire a reference to this node, the node begins writing at the current file position.

    Permissions for Write to Text File

    Use the Set File Position node if you need to perform random access file reads or writes.

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: This product does not support FPGA devices


    Recently Viewed Topics