Write Delimited Spreadsheet

Converts data to a text string and writes the string to a file.

This node creates a text file readable by most spreadsheet applications. This node opens or creates the file before writing to it and closes it afterwards.

1378

Inputs/Outputs

datatype_icon

format

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

Default value: %.3f

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

format string Description
%.3f Creates a string to represent the number with three digits to the right of the decimal point.
%s Copies the input string.
%d Converts the data to integer form using as many characters as necessary to contain the entire number.
datatype_icon

include time channels

A Boolean value that determines whether the resulting spreadsheet will include a column of time values from the input array of waveforms.

This input becomes available only when you wire an array of waveforms to this node.

datatype_icon

file

The file to which this node writes.

If the path is empty, this node uses your default data directory (Documents>>LabVIEW Data).
datatype_icon

2D data

Data the node writes to the file.

This input accepts double-precision floating-point numbers, 64-bit integers, strings, and arrays of waveforms. This input changes to waveforms if you wire an array of waveforms to the node.

datatype_icon

waveforms

Array of waveforms whose y values the node writes to the spreadsheet file.

This input becomes available only if you wire an array of waveforms to the node.

datatype_icon

append to file

A Boolean that determines whether to add data to the end of the file you specify. If you do not specify a file, the node creates a new file.

True Appends data to the existing file.
False Replaces the data in the file.

Default value: False

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

Default value: No error

datatype_icon

delimiter

A character or string of characters used to separate fields in the spreadsheet text. For example, a value of , (comma) specifies a single comma as the delimiter.

Default value: \t — single tab character

datatype_icon

new file

Path to the newly created file.

datatype_icon

error out

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior