Siebel eScript Language Reference > Siebel eScript Commands > File I/O Methods in eScript >

Clib.fscanf() Method


This function reads data from a specified file and stores the data items in a series of parameters.

Syntax

Clib.fscanf(filePointer, formatString, var1, var2, ..., varn)

Parameter
Description

filePointer

A file pointer as returned by Clib.fopen()

formatString

A string containing formatting instructions for each data item to be read

var1, var2, ..., varn

Variables holding the values to be formatted

Returns

The number of input items assigned. This number may be fewer than the number of parameters requested if there was a matching failure. If there is an input failure (before the conversion occurs), this function returns EOF.

Usage

This function reads input from the file indicated by filePointer and stores that input in the var1, var2, ..., varn parameters following the formatString value according to the character combinations in the format string, which indicate how the file data is to be read and stored. The file must be open, with read access.

Characters from input are matched against the formatting instruction characters of formatString until a percent character (%) is reached. The % character indicates that a value is to be read and stored to subsequent parameters following formatString. Each subsequent parameter after formatString gets the next parsed value taken from the next parameter in the list following formatString.

A parameter specification takes this form:

%[*][width]type

For values for these items, read Formatting Input in eScript.

See Also

Clib.sinh() Method
Clib.sscanf() Method

Siebel eScript Language Reference