Create text-based spreadsheet files in LabVIEW by formatting data into a delimited spreadsheet string. LabVIEW includes multiple approaches to create spreadsheets based on the format you need and the needs of your application.

Text-based spreadsheet files are a subset of text files. LabVIEW includes various functions and VIs to format string data as a spreadsheet string. A spreadsheet string is a string that includes delimiters, such as tabs.

You can create multiple types of spreadsheet files with LabVIEW.

To create a spreadsheet file with LabVIEW, choose an approach based on your objective.
OptionDescription
Write data to a spreadsheet of any dimension: multiple data types, streaming capability Use the Format Into File function or the Format Into String function.
Tip Refnums to files perform faster than paths to files. Because Format Into File can accept a file refnum, this option can provide the highest performance for continual writes to the spreadsheet file.

You can write headers to the spreadsheet file with the Write to Text File function.

Write data of any dimension and a single data type to a spreadsheet once Use the Array to Spreadsheet String function.

You can write headers to the spreadsheet file with the Write to Text File function.

Write 1D or 2D data of a single data type to a spreadsheet once Use the Write Delimited Spreadsheet VI.
Create an Excel spreadsheet (.xlsx) Use the Write to Measurement File Express VI.
Write numbers and text to a spreadsheet application or word processing application
  1. Use the String functions and the Array functions to format the data and to combine the strings.
  2. Write the data to a file.
Note Word processing applications format text with different fonts, colors, styles, and sizes. The File I/O VIs cannot process these formatting elements. As a result, reading text from a word processing application might result in errors.

Creating a Spreadsheet for Multiple Data Types with Format Into File

The following VI writes different data types to a text file.

  • Write to Text File function: Writes a header that contains string data and delimiters.
  • Format Into File function: Formats timestamp data, numeric data, and delimiters into a spreadsheet string. Writes the spreadsheet string to the file.
LabVIEW block diagram for writing data to a text file with formatting.