<div dir="ltr"><div><div><div>Hi Mike!<br><br></div>When I try to read the next line, it gets empty, showing [ ]<br><br></div>As I said, I also tried at Windows, where the files were generated, because I was thinking that transportation between OS could cause that, but maybe it's not the case since I got the same results at Windows.<br>

<br></div>Best regards,<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Nov 26, 2013 at 5:58 PM, Mike Page <span dir="ltr"><<a href="mailto:Mike@page-one.waitrose.com" target="_blank">Mike@page-one.waitrose.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><u></u>



<div>
<div><span><font color="#0000ff" face="Arial">Hi 
Eduardo,</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">Sometimes I have had problems like this due to line termination 
characters.  It's possible if a file gets moved from Linux to Windows and 
back again, it can get unexpected CR or LF characters.  Sometimes these are 
read as a garbage line.  I would take a look at your text file with a hex 
editor to make sure the line terminations are what you expect.  
Unfortunately as the file you attached got sent via email I can't tell from 
looking at it what was in your original file.</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">What 
happens when you try to read the next line?</font></span></div>
<div><span><font color="#0000ff" face="Arial"></font></span> </div>
<div><span><font color="#0000ff" face="Arial">HTH,</font></span></div>
<div><span><font color="#0000ff" face="Arial">Mike.</font></span></div><div><div class="h5">
<div><span></span> </div>
<blockquote style="MARGIN-RIGHT:0px" dir="ltr">
  <div dir="ltr" align="left"><font face="Tahoma">-----Original Message-----<br><b>From:</b> users 
  [mailto:<a href="mailto:users-bounces@lists.scilab.org" target="_blank">users-bounces@lists.scilab.org</a>]<b>On Behalf Of </b>Eduardo 
  Torrecillas<br><b>Sent:</b> 26 November 2013 19:43<br><b>To:</b> International 
  users mailing list for Scilab.<br><b>Subject:</b> Re: [Scilab-users] Help with 
  text files<br><br></font></div>
  <div dir="ltr">
  <div>
  <div><br></div>Hi Paul,<br><br>Using phrase=mgetl(fd) turns into the same 
  result: <br><br> phrase  =<br> <br> ÿþ   
  <br><br><br></div>Regards,<br></div>
  <div class="gmail_extra"><br><br>
  <div class="gmail_quote">On Tue, Nov 26, 2013 at 5:22 PM, Paul Carrico <span dir="ltr"><<a href="mailto:paul.carrico@free.fr" target="_blank">paul.carrico@free.fr</a>></span> wrote:<br>
  <blockquote style="BORDER-LEFT:#ccc 1px solid;MARGIN:0px 0px 0px 0.8ex;PADDING-LEFT:1ex" class="gmail_quote">
    <div vlink="purple" link="blue" lang="FR">
    <div>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US">Try basicaly …<u></u><u></u></span></p>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal"><span lang="EN-US">phrase=mgetl(fd)<u></u><u></u></span></p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US">then you’ve an array of characters …<u></u><u></u></span></p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US"><u></u><u></u></span> </p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US">Paul<u></u><u></u></span></p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US"><u></u><u></u></span> </p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US"><u></u><u></u></span> </p>
    <p class="MsoNormal"><span style="FONT-FAMILY:'Calibri','sans-serif';COLOR:#1f497d;FONT-SIZE:11pt" lang="EN-US"><u></u><u></u></span> </p>
    <div style="BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0cm;PADDING-LEFT:0cm;PADDING-RIGHT:0cm;BORDER-TOP:#b5c4df 1pt solid;BORDER-RIGHT:medium none;PADDING-TOP:3pt">
    <p class="MsoNormal"><b><span style="FONT-FAMILY:'Tahoma','sans-serif';FONT-SIZE:10pt">De :</span></b><span style="FONT-FAMILY:'Tahoma','sans-serif';FONT-SIZE:10pt"> users 
    [mailto:<a href="mailto:users-bounces@lists.scilab.org" target="_blank">users-bounces@lists.scilab.org</a>] <b>De la part de</b> 
    Eduardo Torrecillas<br><b>Envoyé :</b> mardi 26 novembre 2013 
    19:14<br><b>À :</b> International users mailing list for 
    Scilab.<br><b>Objet :</b> [Scilab-users] Help with text 
    files<u></u><u></u></span></p></div>
    <div>
    <div>
    <p class="MsoNormal"><u></u><u></u> </p>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">Hello 
    all,<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">I currently have some text 
    files and I would like to extract information from them using Scilab.<br>I 
    have done this before, using mopen and mgetl, for 
    example.<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">Don't know why, but strangely 
    in this case it is not working. I am using Scilab 5.4.1 on Ubuntu (but 
    Scilab 5.4.0 under Windows produced the same 
result).<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">Please check the attached 
    text file.<u></u><u></u></p></div>
    <p class="MsoNormal">Simple code such 
    as:<br><br>fd=mopen('scilab_example.txt','r')<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">phrase=mgetl(fd,1)<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">Produces:<u></u><u></u></p></div>
    <p style="MARGIN-BOTTOM:12pt" class="MsoNormal">phrase=ÿp<u></u><u></u></p></div>
    <p class="MsoNormal">If i still try to use mgetl, next lines are always 
    returned as empty.<br><br>Does anybody have any clue on whats 
    happening?<br><br>Best regards,<br clear="all"><u></u><u></u></p>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <div>
    <p class="MsoNormal"><br>-- <br>Eduardo Torrecillas<br>AER-09 
    <u></u><u></u></p></div></div></div></div></div></div></div></div></div></div></div></div></div></div><br><br>
    <hr style="BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;BACKGROUND-COLOR:#b0b0b0;MIN-HEIGHT:1px;WIDTH:99%;COLOR:#909090;BORDER-TOP:medium none;BORDER-RIGHT:medium none">

    <table style="BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;BORDER-COLLAPSE:collapse;BORDER-TOP:medium none;BORDER-RIGHT:medium none">
      <tbody>
      <tr>
        <td style="BORDER-BOTTOM:medium none;BORDER-LEFT:medium none;PADDING-BOTTOM:0px;PADDING-LEFT:8px;PADDING-RIGHT:15px;BORDER-TOP:medium none;BORDER-RIGHT:medium none;PADDING-TOP:0px"><a href="http://www.avast.com/" target="_blank"><img border="0"> 
          </a></td>
        <td>
          <p style="FONT-FAMILY:'Calibri','Verdana','Arial','Helvetica';COLOR:#3d4d5a;FONT-SIZE:12pt">Ce 
          courrier électronique ne contient aucun virus ou logiciel malveillant 
          parce que la protection <a href="http://www.avast.com/" target="_blank">Antivirus avast!</a> est active. 
    </p></td></tr></tbody></table><br></div><br>_______________________________________________<br>users 
    mailing list<br><a href="mailto:users@lists.scilab.org" target="_blank">users@lists.scilab.org</a><br><a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>

<br></blockquote></div><br><br clear="all"><br>-- <br>Eduardo Torrecillas<br>AER-09 
</div></blockquote></div></div></div>
<br>_______________________________________________<br>
users mailing list<br>
<a href="mailto:users@lists.scilab.org">users@lists.scilab.org</a><br>
<a href="http://lists.scilab.org/mailman/listinfo/users" target="_blank">http://lists.scilab.org/mailman/listinfo/users</a><br>
<br></blockquote></div><br><br clear="all"><br>-- <br>Eduardo Torrecillas<br>AER-09
</div>