Large Ascii Files and "textread.m"

Michael Barton bartonm09 at gmail.com
Mon Jul 7 14:56:52 CDT 2008


Functions fgets and fgetl work; however, I can't get the following strings
read in.

On Mon, Jul 7, 2008 at 11:55 AM, Dmitri A. Sergatskov <
dasergatskov at gmail.com> wrote:

> On Mon, Jul 7, 2008 at 12:49 PM, Michael Barton <bartonm09 at gmail.com>
> wrote:
> > I'm reading a large ascii file.  I want to read entire lines of the file
> and
> > store them as strings.  Also, I need to be able to reference back in
> order
> > to read following lines.  Hopefully, this example can demonstrate what
> I'm
> > trying to do.
> >
> > 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.
> >
> > I/O CODE:
> > MyFileID = fopen("MyAsciiFile.txt", "r");
> > StringLine1 = SomeTextReadingFunction(MyFileID);
> > StringLine2 = SomeTextReadingFunction(MyFileID);
> > StringLine3 = SomeTextReadingFunction(MyFileID);
> >
> > IN OCTAVE MEMORY:
> > StringLine1 = "This is the 1st line of the file."
> > StringLine2 = "This is the 2nd line of the file."
> > StringLine3 = "This is the 3rd line of the file."
> >
> > From sources online, the "textread" should accomplish this.  When I run
> "doc
> > textread", Octave finds no entries. I'm using version 3.0.1 on XP with
> out
> > cygwin.  Any suggestions?
> >
>
> Can you just use fgets/fgetl ?
>
> Dmitri.
> --
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.cae.wisc.edu/pipermail/help-octave/attachments/20080707/add11671/attachment.html 


More information about the Help-octave mailing list