Re: [Scilab-users] Read file (.txt)

2020-09-13 Thread Stefan Du Rietz
On 2020-09-12 16:55, Stefan Du Rietz wrote: On 2020-09-12 00:06, Stefan Du Rietz wrote: On 2020-09-11 19:32, Samuel Gougeon wrote: Le 11/09/2020 à 16:51, Stefan Du Rietz a écrit : Hello Samuel, read() never works OK with m = -1, see your own comment in Bug 15075! This prevented me from

Re: [Scilab-users] Read file (.txt)

2020-09-12 Thread Stefan Du Rietz
On 2020-09-12 00:06, Stefan Du Rietz wrote: On 2020-09-11 19:32, Samuel Gougeon wrote: Le 11/09/2020 à 16:51, Stefan Du Rietz a écrit : 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

Re: [Scilab-users] Read file (.txt)

2020-09-11 Thread Daniel Stringari
Good evening everyone, I appreciate everyone's availability. Great solutions! -- Sent from: http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html ___ users mailing list users@lists.scilab.org

Re: [Scilab-users] Read file (.txt)

2020-09-11 Thread Stefan Du Rietz
On 2020-09-11 19:32, Samuel Gougeon wrote: Le 11/09/2020 à 16:51, Stefan Du Rietz a écrit : 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

Re: [Scilab-users] Read file (.txt)

2020-09-11 Thread Samuel Gougeon
Le 11/09/2020 à 16:51, Stefan Du Rietz a écrit : 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

Re: [Scilab-users] Read file (.txt)

2020-09-11 Thread Stefan Du Rietz
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

Re: [Scilab-users] Read file (.txt)

2020-09-11 Thread Stefan Du Rietz
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).

Re: [Scilab-users] Read file (.txt)

2020-09-10 Thread Samuel Gougeon
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

Re: [Scilab-users] Read file (.txt)

2020-09-10 Thread Jan Åge Langeland
The main problem I ran into with csvRead was reading files with a variable number of separators in each row. Then my suggested solution pads with 0. It could be changed to pad with NaN also. Using strsplit in each row allows for several separators in the same conversion.  It may still be

Re: [Scilab-users] Read file (.txt)

2020-09-10 Thread P M
I think csvRead is just fine. [data header] = csvRead(fname, ' ', '.', 'string', [], [], [], 0); As you may notice the data Matrix contains a lot of empty columns. This is due to the many white spaces in the text file anyways, after reading the dta in you may use evstr() to convert into

Re: [Scilab-users] Read file (.txt)

2020-09-09 Thread Jan Åge Langeland
Hi Daniel I made my own csvread, it seems to read your file OK with exec('JcsvRead3.sce', -1); M=JcsvRead3('output.txt','   '); Brgds Jan On 2020-09-10 0:03 AM, Daniel Stringari wrote: Good evening everyone, I'm integrating scilab with other software, so I need to read an output file

Re: [Scilab-users] Read file (.txt)

2020-09-09 Thread antoine . elias
Hello Daniel, Do you have try with "evstr" function ? data = evstr(mgetl("output.txt")); Regards, Antoine ___ users mailing list users@lists.scilab.org http://lists.scilab.org/mailman/listinfo/users

[Scilab-users] Read file (.txt)

2020-09-09 Thread Daniel Stringari
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