<div dir='ltr'>
hi serge,<br>thanks for you answer i will try it .<br><br><br><div><div id="SkyDrivePlaceholder"></div><hr id="stopSpelling">Date: Thu, 3 Jan 2013 09:50:32 -0800<br>From: <a href="/user/SendEmail.jtp?type=node&node=4025625&i=0" target="_top" rel="nofollow" link="external">[hidden email]</a><br>To: <a href="/user/SendEmail.jtp?type=node&node=4025625&i=1" target="_top" rel="nofollow" link="external">[hidden email]</a><br>Subject: Re: Dot Notation<br><br>
<div class="ecxmoz-cite-prefix">It would be easy if your file contained
something like<br>
ASY.Pr.VER = 2.0<br>
<br>
ASY.Pr.NAME = "Samy"<br>
<br>
ASY.Pr.REKE = "XY"<br>
<br>
ASY.Pr.LOG=[]<br>
Because in such a case you may have only to exec it.<br>
<br>
If you cannot produce such a file maybe you can proceed as follow<br>
<b><br>
</b><b>digits=string(0:9);</b><b><br>
</b><b>txt=stripblanks(mgetl('your file'));</b><b><br>
</b><b>txt(txt=='')=[]; //remove blank lines</b><b><br>
</b><b>n=size(txt,1); //the number of lines</b><b><br>
</b><b>I=[];</b><b><br>
</b><b>for k=1:n</b><b><br>
</b><b> t=tokens(txt(k),"=");</b><b><br>
</b><b> if size(t,'*')==2 then</b><b><br>
</b><b> t2=stripblanks(t(2));</b><b><br>
</b><b> if or(part(t2,1)==digits) then</b><b><br>
</b><b> I=[I;txt(k)];</b><b><br>
</b><b> else</b><b><br>
</b><b> I=[I;t(1)+"="""+t2+""""];</b><b><br>
</b><b> end</b><b><br>
</b><b> else</b><b><br>
</b><b> I=[I;txt(k)+"=[]"];</b><b><br>
</b><b> end</b><b><br>
</b><b>end</b><b><br>
</b><b>clear ASY</b><b><br>
</b><b>execstr(I)</b><b><br>
</b><b>//here ASY is a struct with one field named Pr and ASY.Pr
is a struct</b><b><br>
</b><b>ASY.Pr</b><b><br>
</b><br>
<br>
Serge Steer<br>
<br>
Le 03/01/2013 09:35, samy a écrit :<br>
</div>
<blockquote style='border-left:2px solid #CCCCCC;padding:0 1em' style="border-left:2px solid #CCCCCC;padding:0 1em" cite="mid:1357202109323-4025607.post@n3.nabble.com">
<pre>Hello everyone,
i want to read a text file with the following Output:
ASY.Pr.VER = 2.0
ASY.Pr.NAME = Samy
ASY.Pr.REKE = XY
ASY.Pr.LOG
and give it as a tlist in scilab for example
tlist(['Pr,'VER','NAME','REKE','LOG'],2.0,Samy, XY)
it's possible?
i have a large file
I thank you in advance for any help.
--
View this message in context: <a class="ecxmoz-txt-link-freetext" href="http://mailinglists.scilab.org/Dot-Notation-tp4025607.html" rel="nofollow" target="_blank" link="external">http://mailinglists.scilab.org/Dot-Notation-tp4025607.html</a>
Sent from the Scilab users - Mailing Lists Archives mailing list archive at Nabble.com.
_______________________________________________
users mailing list
<a href="http:///user/SendEmail.jtp?type=node&node=4025609&i=0" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<a class="ecxmoz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a>
</pre>
</blockquote>
<br>
<br>_______________________________________________
<br>users mailing list
<br><a href="http:///user/SendEmail.jtp?type=node&node=4025609&i=1" rel="nofollow" target="_blank" link="external">[hidden email]</a>
<br><a href="http://lists.scilab.org/mailman/listinfo/users" rel="nofollow" target="_blank" link="external">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br>
<br>
<hr color="#cccccc" size="1">
<div style="color:#444;font:12px tahoma,geneva,helvetica,arial,sans-serif">
<div style="font-weight:bold">If you reply to this email, your message will be added to the discussion below:</div>
<a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025609.html" target="_blank" rel="nofollow" link="external">http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025609.html</a>
</div>
<div style="color:#666;font:11px tahoma,geneva,helvetica,arial,sans-serif;line-height:1.5em">
To unsubscribe from Dot Notation, <a href="" target="_blank" rel="nofollow" link="external">click here</a>.<br>
<a href="http://mailinglists.scilab.org/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble:email.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble:email.naml-instant_emails%21nabble:email.naml-send_instant_email%21nabble:email.naml" rel="nofollow" style="font:9px serif" target="_blank" link="external">NAML</a>
</div></div> </div>
<br/><hr align="left" width="300" />
View this message in context: <a href="http://mailinglists.scilab.org/Dot-Notation-tp4025607p4025625.html">RE: Dot Notation</a><br/>
Sent from the <a href="http://mailinglists.scilab.org/Scilab-users-Mailing-Lists-Archives-f2602246.html">Scilab users - Mailing Lists Archives mailing list archive</a> at Nabble.com.<br/>