int FileToArray (char *fileName, void *array, int dataType, int numberOfElements, int numberOfGroups, int arrayDataOrder, int fileLayout, int fileType);
Reads data from a file into an array. You can use FileToArray with files you create using ArrayToFile. FileToArray opens, reads, and closes the file.
Input | ||||||||||||||||||
Name | Type | Description | ||||||||||||||||
fileName | string | Name of the file to read. fileName can be an absolute pathname or a relative filename. If you use a relative filename, FileToArray locates the file relative to the current working directory. |
||||||||||||||||
dataType | integer | Data type of the array. The data in the file should match this data type. dataType must be one of the following data types:
|
||||||||||||||||
numberOfElements | integer | Number of data points to read from the file. | ||||||||||||||||
numberOfGroups | integer | If the file is in ASCII format, numberOfGroups specifies the number of groups into which the data in the file is divided. FileToArray can read groups as columns or rows. If you do not want to read your data as groups, use 1. | ||||||||||||||||
arrayDataOrder | integer | If you divide your data into groups, arrayDataOrder specifies how to store the data from different groups in the array. The choices are as follows:
|
||||||||||||||||
fileLayout | integer | If the file is in ASCII format, fileLayout specifies how the data is arranged in the file. The choices are as follows:
|
||||||||||||||||
fileType | integer | Specifies whether the file is in ASCII or binary format. The choices are as follows:
|
||||||||||||||||
Output | ||||||||||||||||||
Name | Type | Description | ||||||||||||||||
array | void * | Numeric array in which to store the data read from the file. |
Name | Type | Description | ||||||||||||||||||||||
status | integer | Indicates whether the function succeeded or failed. If the value is –1, –2, or –3, you can use GetFmtIOError to get more information about the type of error that occurred.
|