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

fscanf (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the support class.

Syntax

a = fscanf(fid, format)

a = fscanf(fid, format, size)

[a, b] = fscanf(fid, format)

[a, b] = fscanf(fid, format, size)

Description

Reads text in a file and converts the text to an appropriate data type.

Details

Examples

Inputs

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.

Outputs

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.

Details

This function is not supported in the LabVIEW Run-Time Engine. Do not use this function in a stand-alone application or shared library.

Examples

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

Related Topics

fclose
fopen
fread
fseek
sscanf
textread


Resources


 

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