On Mon, Jul 7, 2008 at 1:41 PM, Dmitri A. Sergatskov <
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.
--