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)))'
    tmp(isnan(tmp))=[]
    if size(tmp)==[1 4] then
        res= [res; tmp]
    end
end

--> res(2:3,1:3)

 ans = [2x3 double]

   5.5   6.6   7.7
   9.9   0.    1.1


-----Message d'origine-----
De : users <users-boun...@lists.scilab.org> De la part de Jens Simon Strom
Envoyé : lundi 1 juillet 2024 10:24
À : International users mailing list for Scilab. <users@lists.scilab.org>
Objet : [Scilab-users] Read a matrix embedded in an unstructured text-file

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,
Further        9.9  0.0  1.1  2.2
Some Text, further text,  45   Some Text, further text
This is the last line of the txt-file.


I would like to retrieve the well structured section
5.5  6.6  7.7
9.9  0.0  1.1
as a 2x3 matrix.

csvRead with range=[3 16 4 28] does not work. What can I do instead?

Regards Jens
_______________________________________________
users mailing list - users@lists.scilab.org Click here to unsubscribe: 
<mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

_______________________________________________
users mailing list - users@lists.scilab.org
Click here to unsubscribe: <mailto:users-unsubscr...@lists.scilab.org>
https://lists.scilab.org/mailman/listinfo/users
This email and any attachments are intended solely for the use of the 
individual or entity to whom it is addressed and may be confidential and/or 
privileged.

If you are not one of the named recipients or have received this email in error,

(i) you should not read, disclose, or copy it,

(ii) please notify sender of your receipt by reply email and delete this email 
and all attachments,

(iii) Dassault Systèmes does not accept or assume any liability or 
responsibility for any use of or reliance on this email.


Please be informed that your personal data are processed according to our data 
privacy policy as described on our website. Should you have any questions 
related to personal data protection, please contact 3DS Data Protection Officer 
https://www.3ds.com/privacy-policy/contact/

Reply via email to