<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-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 cite="mid:1357202109323-4025607.post@n3.nabble.com"
      type="cite">
      <pre wrap="">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="moz-txt-link-freetext" href="http://mailinglists.scilab.org/Dot-Notation-tp4025607.html">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 class="moz-txt-link-abbreviated" href="mailto:users@lists.scilab.org">users@lists.scilab.org</a>
<a class="moz-txt-link-freetext" href="http://lists.scilab.org/mailman/listinfo/users">http://lists.scilab.org/mailman/listinfo/users</a>

</pre>
    </blockquote>
    <br>
  </body>
</html>