1
.TH mfscanf 1 "May 1999" "Scilab Group" "Scilab Function"
4
mscanf - interface to the C scanf function
5
mfscanf - interface to the C fscanf function
6
msscanf - interface to the C sscanf function
9
[n,v_1,...v_n]=mfscanf(fd,format)
12
[n,v_1,...v_n]=mscanf(format)
15
[n,v_1,...v_m]=msscanf(format,str)
21
: a Scilab string describing the
22
format to use to write the remaining operands.
23
The format operand follows, as close as possible,
24
the C printf format operand syntax.
27
:The fd parameter returned by the function \fVmopen\fR is used as a
28
file descriptor (it's a positive integer). When specifying the fd
29
parameter, the value -1 refers to the default file ( i.e the last
36
: an integer, the number of data read or -1 if EOL has been
37
encountered before any datum has been read.
40
: Each function reads characters, interprets them according to
41
a format, and stores the results in its output arguments.
42
If more than $n$ output arguments are provided, the last ones
43
\fVv_n+1,...v_m\fR are set to empty matrices.
46
: a matrix of strings or numbers if data read are homogeous or an
47
mlist of type (cblock) containing a sequence of homogeneous matrices
49
The \fVmfscanf\fR function reads characters from the stream \fVfd\fR.
51
The \fVmscanf\fR function reads characters from Scilab window.
53
The \fVmsscanf\fR function reads characters from the Scilab string \fVstr\fR.
58
[n,a,b]=msscanf(s,"%i %e")
62
msscanf(" 12\\n",'%c%c%c%c') //scan characters
64
msscanf('0xabc','%x') //scan with hexadecimal format
67
msscanf('012345abczoo','%[0-9abc]%s') //[] notation
69
//create a file with data
70
u=mopen(TMPDIR+'/foo','w');
71
t=0.5;mfprintf(u,"%6.3f %6.3f\\n",t,sin(t))
72
t=0.6;mfprintf(u,"%6.3f %6.3f\\n",t,sin(t))
75
u=mopen(TMPDIR+'/foo','r');
76
[n,a,b]=mfscanf(u,'%e %e')
82
mclose, meof, mfprintf, fprintfMat, mfscanf, fscanfMat, mget, mgetstr, mopen, mprintf, mput, mputstr, mscanf, mseek, mtell