<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META content="text/html; charset=windows-1252" http-equiv=Content-Type>
<META name=GENERATOR content="MSHTML 8.00.6001.23536"></HEAD>
<BODY>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2 face=Arial>Hi
Eduardo,</FONT></SPAN></DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2
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 class=640465419-26112013><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2 face=Arial>What
happens when you try to read the next line?</FONT></SPAN></DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2
face=Arial></FONT></SPAN> </DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2
face=Arial>HTH,</FONT></SPAN></DIV>
<DIV><SPAN class=640465419-26112013><FONT color=#0000ff size=2
face=Arial>Mike.</FONT></SPAN></DIV>
<DIV><SPAN class=640465419-26112013></SPAN> </DIV>
<BLOCKQUOTE style="MARGIN-RIGHT: 0px" dir=ltr>
<DIV dir=ltr class=OutlookMessageHeader align=left><FONT size=2
face=Tahoma>-----Original Message-----<BR><B>From:</B> users
[mailto:users-bounces@lists.scilab.org]<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 lang=FR vlink="purple" link="blue">
<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 class=h5>
<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 NOSEND="1">
</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">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></BODY></HTML>