Read Delimited Spreadsheet function: Difference between revisions
Appearance
Started page |
m →Usage |
||
| Line 11: | Line 11: | ||
=== Double Instance === | === Double Instance === | ||
[[File:Read Delimited Spreadsheet - Double Instance.png|center]] | |||
{| class="wikitable" | {| class="wikitable" | ||
! Data Type | ! Data Type | ||
| Line 74: | Line 75: | ||
=== Integer Instance === | === Integer Instance === | ||
[[File:Read Delimited Spreadsheet - Integer Instance.png|center]] | |||
{| class="wikitable" | {| class="wikitable" | ||
! Data Type | ! Data Type | ||
| Line 120: | Line 122: | ||
|- | |- | ||
! [[File:I64 1D Array Indicator.png|link=I64 data type]] | ! [[File:I64 1D Array Indicator.png|link=I64 data type]] | ||
| '''first row''' | |||
| '''first row''' is the first row of the '''all rows''' array. You can use this output when you want to read one row into a 1D array. | |||
|- | |||
! [[File:I32 Indicator.png|link=I32 data type]] | |||
| '''mark after read''' | |||
| '''mark after read''' returns the character (byte) in the file following the last character read. | |||
|- | |||
! [[File:Error Cluster Indicator.png|link=Error Cluster data type]] | |||
| '''error out''' | |||
| '''error out''' contains error information. This output provides [[Error Cluster data type|standard error]] out functionality. | |||
|- | |||
! [[File:Boolean Indicator.png|link=Boolean data type]] | |||
| '''EOF?''' | |||
| '''EOF?''' is TRUE ([[File:BooleanTrue2010.png]]) if you attempt to read past the end of file. | |||
|} | |||
=== String Instance === | |||
[[File:Read Delimited Spreadsheet - String Instance.png|center]] | |||
{| class="wikitable" | |||
! Data Type | |||
! Name | |||
! Description | |||
|- | |||
! [[File:String.png|link=String data type]] | |||
| '''format''' | |||
| '''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|format string syntax]]. | |||
|- | |||
! [[File:Path.png|link=Path data type]] | |||
| '''file path''' | |||
| '''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. | |||
|- | |||
! [[File:I32.png|link=I32 data type]] | |||
| '''number of rows''' | |||
| '''number of rows''' is the maximum number of rows or lines the VI reads. For this VI, a row is a character string ending with a carriage return, linefeed, or a carriage return followed by a linefeed; a string ending at the end of file; or a string that has the maximum line length specified by the max characters per row input. If '''number of rows''' is <0, the VI reads the entire file. The default is –1. | |||
|- | |||
! [[File:I32.png|link=I32 data type]] | |||
| '''start of read''' | |||
| '''start of read''' offset specifies the position in the file, in characters (bytes), at which the VI begins reading. The offset unit is bytes rather than numbers because byte stream files can contain segments of different types of data. Therefore, to read an array of 100 numbers that follows a header of 57 characters, set '''start of read''' offset to 57. | |||
|- | |||
! [[File:I32.png|link=I32 data type]] | |||
| '''max characters/row''' | |||
| '''max characters/row''' is the maximum number of characters the VI reads before ending the search for the end of a row or line. The default is 0, which means that there is no limit to the number of characters the VI reads. | |||
|- | |||
! [[File:Error Cluster.png|link=Error Cluster data type]] | |||
| '''error in''' | |||
| '''error in''' describes error conditions that occur before this node runs. This input provides [[Error Cluster data type|standard error]] in functionality. | |||
|- | |||
! [[File:Boolean.png|link=Boolean data type]] | |||
| '''transpose?''' | |||
| '''transpose?''' specifies whether the VI transposes the data after converting it from a string. The default is FALSE ([[File:BooleanFalse2010.png]]). | |||
|- | |||
! [[File:String.png|link=String data type]] | |||
| '''delimiter''' | |||
| '''delimiter''' is the character or string of characters to use to separate fields in the spreadsheet file. For example, a value of <code>,</code> (comma) specifies a single comma as the delimiter. The default is <code>\t</code>, which specifies a single tab character as the delimiter. | |||
|- | |||
! [[File:Path Indicator.png|link=Path data type]] | |||
| '''new file path''' | |||
| '''new file path''' returns the path to the file. | |||
|- | |||
! [[File:String 2D Array Indicator.png|link=String data type]] | |||
| '''all rows''' | |||
| '''all rows''' is the data read from the file. | |||
|- | |||
! [[File:String Array Indicator.png|link=String data type]] | |||
| '''first row''' | | '''first row''' | ||
| '''first row''' is the first row of the '''all rows''' array. You can use this output when you want to read one row into a 1D array. | | '''first row''' is the first row of the '''all rows''' array. You can use this output when you want to read one row into a 1D array. | ||
Revision as of 18:50, 2 December 2020
| |
This article is a stub. You can help LabVIEW Wiki by expanding it. Please improve this article if you can. |
| Object information | |
|---|---|
| Owning palette(s) | File I/O palette |
| Type | VI |
| Requires | Basic Development Environment |
| Icon | |
The Read Delimited Spreadsheet function reads a specified number of lines or rows from a numeric text file beginning at a specified character offset and converts the data to a 2D, double-precision array of numbers, strings, or integers. You must manually select the polymorphic instance you want to use.
You optionally can transpose the array. The VI opens the file before reading from it and closes it afterwards. You can use this VI to read a spreadsheet file saved in text format. This VI calls the Spreadsheet String to Array function to convert the data.
Usage
This VI is polymorphic and has three instances:
Double Instance

| Data Type | Name | Description |
|---|---|---|
| format | 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 | 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. | |
| number of rows | number of rows is the maximum number of rows or lines the VI reads. For this VI, a row is a character string ending with a carriage return, linefeed, or a carriage return followed by a linefeed; a string ending at the end of file; or a string that has the maximum line length specified by the max characters per row input. If number of rows is <0, the VI reads the entire file. The default is –1. | |
| start of read | start of read offset specifies the position in the file, in characters (bytes), at which the VI begins reading. The offset unit is bytes rather than numbers because byte stream files can contain segments of different types of data. Therefore, to read an array of 100 numbers that follows a header of 57 characters, set start of read offset to 57. | |
| max characters/row | max characters/row is the maximum number of characters the VI reads before ending the search for the end of a row or line. The default is 0, which means that there is no limit to the number of characters the VI reads. | |
| error in | error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | |
| transpose? | transpose? specifies whether the VI transposes the data after converting it from a string. The default is FALSE ( | |
| delimiter | 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 | new file path returns the path to the file. | |
| all rows | all rows is the data read from the file. | |
| first row | first row is the first row of the all rows array. You can use this output when you want to read one row into a 1D array. | |
| mark after read | mark after read returns the character (byte) in the file following the last character read. | |
| error out | error out contains error information. This output provides standard error out functionality. | |
| EOF? | EOF? is TRUE ( |
Integer Instance

| Data Type | Name | Description |
|---|---|---|
| format | 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 | 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. | |
| number of rows | number of rows is the maximum number of rows or lines the VI reads. For this VI, a row is a character string ending with a carriage return, linefeed, or a carriage return followed by a linefeed; a string ending at the end of file; or a string that has the maximum line length specified by the max characters per row input. If number of rows is <0, the VI reads the entire file. The default is –1. | |
| start of read | start of read offset specifies the position in the file, in characters (bytes), at which the VI begins reading. The offset unit is bytes rather than numbers because byte stream files can contain segments of different types of data. Therefore, to read an array of 100 numbers that follows a header of 57 characters, set start of read offset to 57. | |
| max characters/row | max characters/row is the maximum number of characters the VI reads before ending the search for the end of a row or line. The default is 0, which means that there is no limit to the number of characters the VI reads. | |
| error in | error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | |
| transpose? | transpose? specifies whether the VI transposes the data after converting it from a string. The default is FALSE ( | |
| delimiter | 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 | new file path returns the path to the file. | |
| all rows | all rows is the data read from the file. | |
| first row | first row is the first row of the all rows array. You can use this output when you want to read one row into a 1D array. | |
| mark after read | mark after read returns the character (byte) in the file following the last character read. | |
| error out | error out contains error information. This output provides standard error out functionality. | |
| EOF? | EOF? is TRUE ( |
String Instance

| Data Type | Name | Description |
|---|---|---|
| format | 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 | 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. | |
| number of rows | number of rows is the maximum number of rows or lines the VI reads. For this VI, a row is a character string ending with a carriage return, linefeed, or a carriage return followed by a linefeed; a string ending at the end of file; or a string that has the maximum line length specified by the max characters per row input. If number of rows is <0, the VI reads the entire file. The default is –1. | |
| start of read | start of read offset specifies the position in the file, in characters (bytes), at which the VI begins reading. The offset unit is bytes rather than numbers because byte stream files can contain segments of different types of data. Therefore, to read an array of 100 numbers that follows a header of 57 characters, set start of read offset to 57. | |
| max characters/row | max characters/row is the maximum number of characters the VI reads before ending the search for the end of a row or line. The default is 0, which means that there is no limit to the number of characters the VI reads. | |
| error in | error in describes error conditions that occur before this node runs. This input provides standard error in functionality. | |
| transpose? | transpose? specifies whether the VI transposes the data after converting it from a string. The default is FALSE ( | |
| delimiter | 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 | new file path returns the path to the file. | |
| all rows | all rows is the data read from the file. | |
| first row | first row is the first row of the all rows array. You can use this output when you want to read one row into a 1D array. | |
| mark after read | mark after read returns the character (byte) in the file following the last character read. | |
| error out | error out contains error information. This output provides standard error out functionality. | |
| EOF? | EOF? is TRUE ( |
History
| |
History information is needed. What changes have occurred over previous versions? |
| Version | Change(s) |
|---|---|
| More info to come. |
See Also
| |
Add links to internal resources that would also help. |
External Links
| |
Add links to external resources that would also help. |