Array to Spreadsheet String
- Updated2023-02-17
- 4 minute(s) read
Array to Spreadsheet String
Converts an array of any dimension to a delimited string that mimics a spreadsheet with rows, columns, and pages.
Inputs/Outputs

format string
A string that includes a single format specifier to determine how to convert each element of an array into text.
Each format specifier uses the following general syntax:
% modifiersspecifier
This node allows only the following specifiers: s, d, and f. Use %s to convert an array of strings to spreadsheet string. Use %d or %f to convert an array of numbers to spreadsheet string.
Modifiers for Numeric Specifiers (x, o, b, d, u, f, e, g, p)
If you use multiple modifiers, they must appear in the following order:
%[-][+][#][0][width][.precision || _significantDigits]specifier
| Modifier | Definition | Usage Example | Output for 12345 |
|---|---|---|---|
| 0 |
Pads any excess space to the left of a numeric parameter with zeros rather than with spaces to reach minimum width. |
%06_2f | 012000 |
| + |
Includes the sign of the number even when the number is positive. |
%+6_2f | +12000 |
| # |
Removes zeros at the end of the number. |
||
| - |
Left justifies the output within its width. If the node inserts spaces to create the specified width, the spaces appear to the right of the value. |
%-6_2f | 12000_ |
| width |
A number specifying the minimum number of characters that the node uses in the output. If the value requires fewer characters, the node pads the output with spaces to meet this width. This width is not a maximum width. The node uses as many characters as necessary to output the value without truncating it. Non-numeric characters, such as a decimal point or negative sign, count toward the total width of an output string. If width is missing or 0, the output uses only as many characters as necessary to contain the formatted value. |
%6f | _12345 |
| width . precision |
A number specifying how many digits appear to the right of the decimal point in the output. If neither .precision nor _significantDigits is present, the node uses a precision of six digits. If precision is 0, the node rounds the value to the nearest whole number. |
%6.2f | 12345.00 |
| width _ significantDigits |
A number specifying how many significant digits appear in the output. The node rounds the data only for display purposes, which does not affect the original data. You cannot use .precision and _significantDigits together in a single format specifier. |
%6_2f | _12000 |
Modifiers for the String Specifier (s)
Use the following syntax to format a string:
%[-]width s
| Modifier | Definition |
|---|---|
| - |
Left justifies the output within its width. If the node inserts spaces to create the specified width, the spaces appear to the right of the value. |
| width |
A number specifying the minimum number of characters that the node uses in the output. If the value requires fewer characters, the node pads the output with spaces to meet this width. This width is not a maximum width. The node uses as many characters as necessary to output the value without truncating it. If width is missing or 0, the output uses only as many characters as necessary to contain the formatted value. |
Syntax for Literal Text Outside the Format Specifier
Most text you enter outside the format specifier appears literally in the output for each array element. However, you must use the following syntax if you want to output certain special characters.
| Syntax | Definition |
|---|---|
| \00 - \FF | Hex value of an 8-bit character; must be uppercase |
| \b | Backspace (ASCII BS, equivalent to \08) |
| \f | Form feed (ASCII FF, equivalent to \0C) |
| \n | Linefeed (ASCII LF, equivalent to \0A). Format into File automatically converts this code into the platform-dependent end-of-line character. |
| \r | Carriage return (ASCII CR, equivalent to \0D) |
| \t | Tab (ASCII HT, equivalent to \09) |
| \s | Space (equivalent to \20) |
| \\ | Backslash (ASCII \, equivalent to \5C) |
| %% | Percent sign |

array
The values to convert to text.

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

spreadsheet string
A string containing the data from array that mimics the table layout of a spreadsheet.
This string separates column elements with a specified delimiter, separates rows with a platform-dependent EOL character, and separates higher dimensions with a special header syntax of the form [highest dimension index, next highest dimension index, ... , 0, 0], where the final 0's refer to the first row and column elements of the page.