Please replace my latest e-mail with this.

Hello Samuel,

read() never works OK with m = -1, see your own comment in Bug 15075!

This prevented me from upgrading to Scilab 6 until I found out how to do it with fscanfMat(). But then I had to remove all blank lines in my files (which I had to quickly find different parts of my data).

--> tic(), M = fscanfMat(myfile); toc()
  ans  =
    0.125278

--> size(M)
  ans  =
    13702.   9.

--> tic(), M = mgetl(myfile); toc()
  ans  =
    0.050891
--> tic(), M = evstr(M); toc()
  ans  =
    1.854611

evstr is slow with large text vectors, compared to file reading.

--> size(evstr(mgetl(myfile, 1)), 2)
  ans  =
    9.
--> tic(), M = read(myfile, -1, 9); toc()
  ans  =
    17.418157

So you have to know the file size completely (and when do you?)!

--> tic(), M = read(myfile", 13702, 9); toc()
  ans  =
    0.085636

Regards
Stefan


On 2020-09-10 22:42, Samuel Gougeon wrote:
Hello Daniel,

In addition to Antoine simple and efficient solution, the following works as well (and may be a bit faster for big files. To be confirmed):

File  =  "output.txt";
m  =  read(File,-1, size(evstr(mgetl(File,1)),2));
Regards


Le 10/09/2020 à 00:03, Daniel Stringari a écrit :
Good evening everyone,

I'm integrating scilab with other software, so I need to read an output file
(.txt), like the one attached (output).

It is worth mentioning that this file does not always have the same
dimensions (matrix), so I am trying to find something robust that can deal
with this particularity. I tried to use the 'csvread' function and the
'read' function, but I still haven't been successful ... Any suggestions?

output.txt<http://mailinglists.scilab.org/file/t498028/output.txt>


_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users
_______________________________________________
users mailing list
[email protected]
http://lists.scilab.org/mailman/listinfo/users

Reply via email to