Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

Write To Spreadsheet File VI

LabVIEW 2012 Help

Edition Date: June 2012

Part Number: 371361J-01

»View Product Info

Owning Palette: File I/O VIs and Functions

Requires: Base Package

Converts a 2D or 1D array of strings, signed integers, or double-precision numbers to a text string and writes the string to a new byte stream file or appends the string to an existing file. Wire data to the 2D data input or 1D data input to determine the polymorphic instance to use or manually select the instance.

Use this VI to transpose or separate data.

Note  To format with Microsoft Excel, use ActiveX with LabVIEW or the Report Generation Toolkit for Microsoft Office.

Details  Example

Use the pull-down menu to select an instance of this VI.

Double

format specifies how to convert the numbers to characters. If the format is %.3f (default), the VI creates a string long enough to contain the number, with three digits to the right of the decimal point. If format is %d, the VI converts the data to integer form using as many characters as necessary to contain the entire number. If format is %s, the VI copies the input string. Use the format string syntax.
file path is the path name of the file. If file path is empty (default) or is <Not A Path>, the VI displays a dialog box from which you can select a file. Error 43 occurs if you cancel the dialog box.
2D data contains the data the VI writes to the file if 1D data is not wired or is empty.
1D data contains the data the VI writes to the file if this input is not empty. The VI converts the 1D array into a 2D array before proceeding. If transpose? is FALSE, each call to this VI creates a new line or row in the file.
If append to file? is TRUE, the VI appends data to an existing file. If append to file? is FALSE (default), the VI replaces data in an existing file. If there is no existing file, the VI creates a new file.
If transpose? is TRUE, the VI transposes the data after converting it from a string. The default is FALSE.
delimiter is the character or string of characters to use to separate fields in the spreadsheet file. For example, a value of , (comma) specifies a single comma as the delimiter. The default is \t, which specifies a single tab character as the delimiter.
new file path returns the path to the file.

String

format specifies how to convert the numbers to characters. If format is %s (default), the VI copies the input string. If the format is %.3f, the VI creates a string long enough to contain the number, with three digits to the right of the decimal point. If format is %d, the VI converts the data to integer form using as many characters as necessary to contain the entire number. Use the format string syntax.
file path is the path name of the file. If file path is empty (default) or is <Not A Path>, the VI displays a dialog box from which you can select a file. Error 43 occurs if you cancel the dialog box.
2D data contains the data the VI writes to the file if 1D data is not wired or is empty.
1D data contains the data the VI writes to the file if this input is not empty. The VI converts the 1D array into a 2D array before proceeding. If transpose? is FALSE, each call to this VI creates a new line or row in the file.
If append to file? is TRUE, the VI appends data to an existing file. If append to file? is FALSE (default), the VI replaces data in an existing file. If there is no existing file, the VI creates a new file.
If transpose? is TRUE, the VI transposes the data after converting it from a string. The default is FALSE.
delimiter is the character or string of characters to use to separate fields in the spreadsheet file. For example, a value of , (comma) specifies a single comma as the delimiter. The default is \t, which specifies a single tab character as the delimiter.
new file path returns the path to the file.

Integer

format specifies how to convert the numbers to characters. If format is %d (default), the VI converts the data to integer form using as many characters as necessary to contain the entire number. If the format is %.3f, the VI creates a string long enough to contain the number, with three digits to the right of the decimal point. If format is %s, the VI copies the input string. Use the format string syntax.
file path is the path name of the file. If file path is empty (default) or is <Not A Path>, the VI displays a dialog box from which you can select a file. Error 43 occurs if you cancel the dialog box.
2D data contains the data the VI writes to the file if 1D data is not wired or is empty.
1D data contains the data the VI writes to the file if this input is not empty. The VI converts the 1D array into a 2D array before proceeding. If transpose? is FALSE, each call to this VI creates a new line or row in the file.
If append to file? is TRUE, the VI appends data to an existing file. If append to file? is FALSE (default), the VI replaces data in an existing file. If there is no existing file, the VI creates a new file.
If transpose? is TRUE, the VI transposes the data after converting it from a string. The default is FALSE.
delimiter is the character or string of characters to use to separate fields in the spreadsheet file. For example, a value of , (comma) specifies a single comma as the delimiter. The default is \t, which specifies a single tab character as the delimiter.
new file path returns the path to the file.

Write To Spreadsheet File Details

When you use this VI to transpose the data, the VI opens or creates the file before writing to it and closes it afterwards. You can use this VI to create a text file readable by most spreadsheet applications. This VI calls the Array To Spreadsheet String function to convert the data.

Example

Refer to the EMail with Data VI in the labview\examples\comm\smtpex.llb for an example of using the Write To Spreadsheet File VI.


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit