Member of the support class.
a = fscanf(fid, format)
a = fscanf(fid, format, size)
[a, b] = fscanf(fid, format)
[a, b] = fscanf(fid, format, size)
Reads text in a file and converts the text to an appropriate data type.
| Name | Description |
| fid | Specifies the identifier for the file you want to read. Use the fopen function to open a file and assign it an identifier. fid is an integer. |
| format | Specifies the format in which to read text from the file. format must use the appropriate format specifier syntax. format is a string. |
| size | Specifies the amount of text to read from the file. LabVIEW discards all but the first two elements of size. If size is inf, LabVIEW reads from the file using the specified format until all the text is read or an error occurs. size can be a scalar or a vector. |
| Name | Description |
| a | Returns the text that LabVIEW reads from the file specified by fid. a can be a vector or a matrix of doubles or characters. |
| b | Returns the amount of text that LabVIEW reads successfully from the file specified by fid. b is a positive integer. |
This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.
fid = fopen('test.dat', 'r');
[a, b] = fscanf(fid, '%[a-z] %*d %f', 10);
fclose(fid);