help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Large Ascii Files and "textread.m"


From: Michael Barton
Subject: Re: Large Ascii Files and "textread.m"
Date: Mon, 7 Jul 2008 14:23:14 -0700

My apologies. Works great! Thanks for the help.

On Mon, Jul 7, 2008 at 1:41 PM, Dmitri A. Sergatskov <address@hidden> wrote:
On Mon, Jul 7, 2008 at 2:56 PM, Michael Barton <address@hidden> wrote:
> Functions fgets and fgetl work; however, I can't get the following strings
> read in.
>

You have to be more specific.

octave:1> MyFileID = fopen("MyAsciiFile.txt", "r");
octave:2> StringLine1 = fgets(MyFileID);
octave:3> StringLine2 = fgets(MyFileID);
octave:4> StringLine3 = fgets(MyFileID);
octave:5> StringLine1
StringLine1 = This is the 1st line of the file.

octave:6> StringLine2
StringLine2 = This is the 2nd line of the file.

octave:7> StringLine3
StringLine3 = This is the 3rd line of the file.

====

$ cat MyAsciiFile.txt
This is the 1st line of the file.
This is the 2nd line of the file.
This is the 3rd line of the file.

====

Seems to be working fine here...

Dmitri.
--


reply via email to

[Prev in Thread] Current Thread [Next in Thread]