Table Of Contents

Create File with Incrementing Suffix (G Dataflow)

Last Modified: January 12, 2018

Creates a file and appends an incrementing number suffix to the filename if the file already exists at a specified path. If the file does not exist, this node creates the file without appending an incrementing number suffix to the filename.

connector_pane_image
datatype_icon

format string

A string that uses format specifiers to determine how to convert the data into what you specify.

Syntax Elements for Creating a Format Specifier

Use the following syntax elements to create a format specifier for the input string.

Syntax Element Description
% Syntax element that begins the format specifier.
$ (optional) Modifier that specifies the order in which to display variables when used within a formatting node. Include the digit that represents the order of the variable immediately before this modifier.
- (optional) Modifier that justifies the parameter to the left, within its width, when used within a formatting node.
+ (optional) Modifier that includes mathematical symbols when used within a formatting node.
spd-note-note
Note  

The mathematical symbols appear even when the number is positive.

^ (optional) Modifier that formats the number in engineering notation, where the exponent is always a multiple of three.
spd-note-note
Note  

This modifier must be used within a formatting node that has either an e or g conversion code in the format specifier.

# (optional) Modifier that removes trailing zeros when used within a formatting node. If the number has no fractional part, this modifier also removes the description part.
0 (optional) Modifier that pads any excess space to the left of a numeric parameter with zeros, rather than spaces, to reach a minimum width when used within a formatting node.
spd-note-note
Note  

Using the - modifier with 0 nullifies the effect.

Width (optional) Syntax element that specifies an exact field width to use. When used within a formatting node, the Width element specifies the minimum character field with of the output. The field is padded to the left or right of the parameter with spaces, depending on justification.
spd-note-note
Note  

As many characters as necessary are used to format the parameter without truncating it.

.Precision or _Significant Digits (optional) Syntax element that controls the number of digits displayed when used within a formatting node.
  • .precision—Yields the number of digits to the right of the decimal point.
  • _Significant Digits—Rounds the data to the number of digits you specify.
spd-note-note
Note  

You cannot use precision and significant digits together in a single format specifier.

{Unit} (optional) Syntax element that overrides the original unit of a VI when you use a node to convert a physical quantity.
<Embedded Time Format> (optional) Contains a time-specific format string for use with the T (absolute time) and the t (relative time) conversion codes.
spd-note-note
Note  

Only %W, %D, %H, %M, %S, and %u apply to relative time.

Conversion Codes Characters that specify how to scan or format a parameter.
  • x—Hexadecimal integer
  • o—Octal integer
  • b—Binary integer
  • d—Signed decimal integer
  • u—Unsigned decimal integer
  • f—Floating-point number with fractional format
  • e—Floating-point number in scientific notation
  • g—Uses f or e depending on the exponent of the number
  • p—Floating-point number in SI notation
  • s—Scans a string, matching only up to the next white-space character.
  • [ ]—Scans characters in a set, matching a string that contains only the characters specified between the brackets.
  • % [aeiou]—Scans characters in a set, matching any string that contains only lowercase vowels
  • % [0-9a-zA-Z ]— Scans characters in a set, matching a string that contains numbers, letters, or spaces. You can use a hyphen to specify ranges of characters in the set.
  • % [^,;]— Scans characters in a set, matching any sting of characters up to but not including the first comma or semicolon.
  • T—Absolute time
  • t—Relative time
Localization Codes Characters that determine whether to use a decimal or a comma to separate the whole number from the decimal part of the number.
  • %,;—Comma decimal separator
  • %.;—Period decimal separator
  • %;—System default separator
Backslash (\) Codes Characters that specify hex values, spacing, backspaces, and other formatting options.

Format Specifier Examples for Format String

format string file path actual path Comments
 %d C:\test.txt C:\test (1).txt The %d in format string specifies that the node appends an incrementing number starting with 1 to the filename before the period (.).
spd-note-note
Note  

There is a space at the beginning of the format string.

%4d C:\test.txt C:\test   1.txt The 4 in format string specifies that the suffix after the filename and before the period (.) has a width of 4.

Default:   %d

datatype_icon

file

Absolute path to the file you want to create. If you specify an empty or relative path, this node returns an error.

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

disable buffering

A Boolean that specifies whether the file opens without buffering, which, for large amounts of data, may increase the rate of data transfer to the file.

True The file opens without buffering.
False The file opens with buffering.

Default: False

datatype_icon

reference

A reference to the file this node creates.

datatype_icon

actual path

Path to the file this node creates.

datatype_icon

error out

The node produces this output according to standard error behavior.

This node can return the following error codes.

1430 The path is empty or relative. You must use an absolute path.
spd-note-note
Note  

This is not a comprehensive list of errors this node can return.

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.

Where This Node Can Run:

Desktop OS: Windows

FPGA: This product does not support FPGA devices

Web Server: Not supported in VIs that run in a web application


Recently Viewed Topics