Array To Spreadsheet String Function

Converts an array of any dimension to a table in string form, containing tabs separating column elements, a platform-dependent EOL character separating rows, and, for arrays of three or more dimensions, headers separating pages.


icon

Inputs/Outputs

  • cstr.png delimiter (Tab)

    delimiter is the value used to separate fields in the spreadsheet file. The default is a single tab character.

  • cstr.png format string

    format string specifies how to convert the input array into a string. Use %s to convert an array of strings to spreadsheet string. Use %d or %f to convert arrays of numbers to spreadsheet string.

    Use the format string syntax.

    Note This function allows you to use only a single format specifier to format all elements of an array. You cannot wire multiple specifiers to this function to format some array elements according to one specifier and some elements to a different specifier.
  • c2ddbl.png array

    array specifies the input samples.

  • istr.png spreadsheet string

    spreadsheet string is separated into columns by delimiters, such as tabs, and an end-of-line (EOL) character separates rows.

  • For arrays of three dimensions or more, each page is preceded by a series of indexes of the following format.

    [n,m,…,0,0]

    where n is the highest dimension index, m is the next highest dimension index, a comma (,) separates indexes, 0,0 refers to the first row and column elements of page n,m,…, and represents the end-of-line character.

    In the following example, a spreadsheet string of a 4x4x3 array appears as it does when you print it. The period character (.) represents omitted values of the latter pages, and the end-of-line character () does not appear in an actual printout.

    [0,0,0]
    1.3 2.6 5.7
    3.9 –4.2 6.5
    –5.5 9.3 3.3
    9.6 9.8 0.4
    [1,0,0]
    . . .
    . . .
    . . .
    . . .
    [2,0,0]
    . . .
    . . .
    . . .
    . . .
    [3,0,0]
    . . .
    . . .
    . . .
    . . .

    Examples

    Refer to the following example files included with LabVIEW.

    • labview\examples\Arrays\Array to Spreadsheet String.vi