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: Ben Abbott
Subject: Re: Large Ascii Files and "textread.m"
Date: Mon, 07 Jul 2008 13:34:48 -0700

 
On Monday, July 07, 2008, at 04:06PM, "Michael Barton" <address@hidden> wrote:
>Functions fgets and fgetl work; however, I can't get the following strings
>read in.

There's not enough context to figure out what is wrong, but the code below does 
what you want.

fid = fopen ("test.txt");
line = {};
line{end+1} = fgetl (fid);
line{end+1} = fgetl (fid);
line{end+1} = fgetl (fid);
fclose(fid);
line
line =

{
  [1,1] = This is the 1st line of the file.
  [1,2] = This is the 2nd line of the file.
  [1,3] = This is the 3rd line of the file.
}

Ben


reply via email to

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