Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

Creating Text and Spreadsheet Files

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

To write data to a text file, you must convert your data to a string. To write data to a spreadsheet file, you must format the string as a spreadsheet string, which is a string that includes delimiters, such as tabs.

Writing text to text files requires no formatting because most word processing applications that read text do not require formatted text. To write a text string to a text file, use the Write to Text File function, which automatically opens and closes the file.

Use the Write to Binary File function to create platform-independent text files. Use the Read from Binary File function to read platform-independent text files.

Use the Write To Spreadsheet File VI or the Array To Spreadsheet String function to convert a set of numbers from a graph, a chart, or an acquisition into a spreadsheet string.

Reading text from a word processing application might result in errors because word processing applications format text with different fonts, colors, styles, and sizes that the File I/O VIs cannot process.

If you want to write numbers and text to a spreadsheet or word processing application, use the String functions and the Array functions to format the data and to combine the strings. Then write the data to a file.

Formatting and Writing Data to Files

Use the Format Into File function to format string, numeric, path, and Boolean data as text and to write the formatted text to a file. Often you can use this function instead of separately formatting the string with the Format Into String function and writing the resulting string with the Write to Text File function.

Scanning Data from Files

Use the Scan From File function to scan text in a file for string, numeric, path, and Boolean values and then convert the text into a data type. Often you can use this function instead of reading data from a file with the Read from Binary File function or Read from Text File function and scanning the resulting string with the Scan From String function.


Resources


 

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