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

Jens Simon Strom j.s.strom at hslmg.de
Sat Mar 4 08:44:15 CET 2017


Thanks Serge,

That seems to be the most convenient solution to me.

Regards,  Jens
-----------------------------------------------------------------------------------
Am 03.03.2017 21:58, schrieb Serge Steer:
> 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
>
>
>
>
> _______________________________________________
> 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/20170304/8712e355/attachment.htm>


More information about the users mailing list