[Scilab-users] Put .txt data in matrix

GOBILLOT Gilles 116128 gilles.gobillot at cea.fr
Thu Dec 12 11:01:07 CET 2013


I use to read text files with Scilab. This piece of code is close to the one I use.

To save time, one can give a dimension to ‘m’ :
Instead of m=[]
Prefer m=zeros(10000,4); // by-exemple


Gilles
Tel : +33 (0)4 42 25 20 33 -  Mob : +33 (0) 6 87 99 19 57 - Fax : +33 (0)4 42 25 49 17
gilles.gobillot at cea.fr<mailto:gilles.gobillot at cea.fr>


De : users [mailto:users-bounces at lists.scilab.org] De la part de simon_37
Envoyé : jeudi 12 décembre 2013 10:46
À : users at lists.scilab.org
Objet : Re: [Scilab-users] Put .txt data in matrix

Hi Osvaldo,
Thanks for your reply.
I think your "piece" of code is the most efficient that I search.
But Scilab don't recognize the "not" in the while loop parameters...
I am trap.
Regards
Simon


2013/12/11 Osvaldo Carvalho [via Scilab / Xcos - Mailing Lists Archives] <[hidden email]</user/SendEmail.jtp?type=node&node=4028020&i=0>>
If you want to ignore exactly the first 15 lines, you can use:

f = mopen("your file","r");
garbage = mgetl(f,15);
m = [];
while not meof(f)
    line = mgetl(f,1); // read one line
    lineNr = eval(tokens(line))'; // dont forget the '
    m = [m;lineNr]; // add one line to m
end

-----"users" <[hidden email]<http://user/SendEmail.jtp?type=node&node=4028015&i=0>> escreveu: -----
Para: [hidden email]<http://user/SendEmail.jtp?type=node&node=4028015&i=1>
De: simon_37
Enviado por: "users"
Data: 11/12/2013 01:50 PM
Assunto: Re: [Scilab-users] Put .txt data in matrix
It doesn't work to, I already try it.
It return me error 999


--
View this message in context: http://mailinglists.scilab.org/Put-txt-data-in-matrix-tp4028011p4028013.html

Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
[hidden email]<http://user/SendEmail.jtp?type=node&node=4028015&i=2>
http://lists.scilab.org/mailman/listinfo/users

_______________________________________________
users mailing list
[hidden email]<http://user/SendEmail.jtp?type=node&node=4028015&i=3>
http://lists.scilab.org/mailman/listinfo/users

________________________________
If you reply to this email, your message will be added to the discussion below:
http://mailinglists.scilab.org/Put-txt-data-in-matrix-tp4028011p4028015.html
To unsubscribe from Put .txt data in matrix, click here.
NAML<http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>


________________________________
View this message in context: Re: Put .txt data in matrix<http://mailinglists.scilab.org/Put-txt-data-in-matrix-tp4028011p4028020.html>
Sent from the Scilab users - Mailing Lists Archives mailing list archive<http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html> at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20131212/f267a533/attachment.htm>


More information about the users mailing list