[Scilab-users] read format

Collewet Guylaine guylaine.collewet at irstea.fr
Mon Oct 12 16:28:15 CEST 2015


Hello,

Perhaps this could help (there is probably a more direct way to do it)

str1="00:01:00;5.49;1";
str2=strchr(str1,';');   //str2= ";5.49;1"
str3=strtok(str2,';'); // str3 = "5.49"
d =  strtod(str3);

Regards

Guylaine

-----Message d'origine-----
De : users [mailto:users-bounces at lists.scilab.org] De la part de grivet
Envoyé : lundi 12 octobre 2015 14:27
À : users at lists.scilab.org
Objet : [Scilab-users] read format

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