[Scilab-users] read format

Serge Steer Serge.Steer at inria.fr
Mon Oct 12 17:16:32 CEST 2015


with s given as follow
s=['        01/03/2015 00:01:00;5.49;1'
'        01/03/2015 00:01:01;5.9;1'
'        01/03/2015 00:01:11;4.9;1']
The following instructions returns the expexted results
msscanf(-1,s,"%*s %*2s%*[:]%*2s%*[:]%*2s%*[;]%g[^;]%*[;]")

But I do not succeed if the data are stored in a file
u=mopen("....","r")
mfscanf(-1,u,"%*s %*2s%*[:]%*2s%*[:]%*2s%*[;]%g[^;]%*[;]")
returns an error

I think a C format specialist could be able to find my error

Serge
Le 12/10/2015 14:26, grivet a écrit :
> Hello,
> I have a data file of about 80k lines. A typical line looks like this:
>         01/03/2015 00:01:00;5.49;1
> (date time; value;parameter). I am only interested in the field
> "value", which can be 3 or 4
> characters wide (i.e. 5.49 or 5.4).
> How can I extract the desired data from this file ?
> Thank you for your help.
> JP Grivet
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users
>




More information about the users mailing list