[Scilab-users] Reading numericaldata from txt file containing headlines

Serge Steer Serge.Steer at inria.fr
Fri Mar 3 21:58:26 CET 2017


You can proceed as follow without any change in your file:

u=mopen("myfile","r");
header=mgetl(u,4)

data=mfscanf(-1,u,"%f %f\n")

Le 03/03/2017 à 13:09, Jens Simon Strom a écrit :
> Hi,
> with
> x=read(file,-1,2)
> I can read the data from a text file containing e. g.
>
> 1  2.12       First line of text file
> 2.12   3.2
> 3 2
> 4  2
> 5 2.
> 6     2
> 7 2
>             Last line empty
>
> What can I do to read only the numbers from a text file like
>
> Header 1     First line of text file
> Header 2
>
>
> 1 2.12
> 2.12 3.2
> 3 2
> 4 2
> 5 2.
> 6 2
> 7 2
>             Last line empty
>
> where the data start in the 5th line?
>
> Regards, Jens
>
>
>
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20170303/54254a68/attachment.htm>


More information about the users mailing list