[Scilab-users] Read a matrix embedded in an unstructured text-file

2024-07-01 Thread Jens Simon Strom
Hallo Scilab experts, given is a text-file like: This is the first line of the txt-file. Some Text 1.1 2.2 3.3 4.4 Further Text 5.5 6.6 7.7 8.8 Some Text, further text, Further9.9 0.0 1.1 2.2 Some Text, further text, 45 Some Text, further text This is the last line o

Re: [Scilab-users] Read a matrix embedded in an unstructured text-file

2024-07-01 Thread CHEZE David
Hi Jens, With fname the file path to your text file, the following script is actually extracting the regular numerical data 'res' as a nx4 matrix of real , then you may extract the specific data that you mentioned . David sf= mgetl(fname); res=[] for i=1:size(sf,1) tmp= strtod(tokens(sf(i