[Scilab-users] read format

Clément David clement.david at scilab-enterprises.com
Mon Oct 12 18:07:54 CEST 2015


Hello,

Well in fact the `evstr` call is not needed if you parse the csv and
interpreting directly the values as "double" using :

M = csvRead('/tmp/sample.csv', ';', "double");
values = M(:,2);

Regards,

--
Clément

Le lundi 12 octobre 2015 à 18:00 +0200, grivet a écrit :
> Thank you Samuel, this works like a charm, even though the last step 
> (evstr) takes a couple of minutes (80000 lines!).
> For a completely different solution: read the file into emacs, define
> a 
> rectangle of width 20 chars and height the whole file, delete this 
> rectangle, search for ".1" and erase every occurence of this string.
> Thanks to everybody,
> JP Grivet
> 
> > 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 ?
> > .
> > Likely with
> > M  = csvRead(TheFileName, ";", ".", "string");
> > values = evstr(M(:,2));
> > 
> > Samuel Gougeon
> > 
> 
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



More information about the users mailing list