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

fscanf (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: support

Requires: MathScript RT Module


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 is a scalar or a vector.


Name Description
a Returns the text that LabVIEW reads from the file specified by fid. a is a vector or 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.


The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized


fid = fopen('test.dat', 'r');
[a, b] = fscanf(fid, '%[a-z] %*d %f', 10);

Related Topics



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