[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: textscan wanted
From: |
Ben Abbott |
Subject: |
Re: textscan wanted |
Date: |
Thu, 21 Oct 2010 08:33:24 +0800 |
For the developer's sources, strread is part of the core. I just checked the
sources, it was added 12 months ago.
http://hg.savannah.gnu.org/hgweb/octave/log/d3eaaa7c6762/scripts/io/strread.m
I don't know if it can be transplanted into prior versions and work correctly.
Ben
On Oct 21, 2010, at 2:52 AM, Dr. Johannes Zellner wrote:
> Ben,
>
> thanks // where do I get strread which is used in your function?
> --
> Johannes
>
>
> 2010/10/20 Ben Abbott <address@hidden>
> On Oct 20, 2010, at 1:55 PM, Ben Abbott wrote:
>
> > On Oct 20, 2010, at 1:39 PM, Dr. Johannes Zellner wrote:
> >
> >> 2010/10/20 Ben Abbott <address@hidden>
> >> On Oct 20, 2010, at 4:53 AM, Dr. Johannes Zellner wrote:
> >>
> >>>> Hi,
> >>>>
> >>>> I've a bunch of matlab files which use textscan.
> >>>>
> >>>> I don't want to replace all textscan calls with something like fscanf
> >>>> but I'd rather like to have an octave function which implements
> >>>> textscan().
> >>>>
> >>>> Does anyone have a textscan implementation?
> >>>>
> >>>> regards,
> >>>>
> >>>> --
> >>>> Johannes.
> >>>
> >>> I've opened a ticket in the bug tracker.
> >>>
> >>> https://savannah.gnu.org/bugs/index.php?31380
> >>>
> >>> For now, have you looked at using textread() instead? Unfortunately,
> >>> textread() is not fully compatible with the ML version.
> >>>
> >>> The syntax for ML's textscan is ...
> >>>
> >>> C = textscan (fid, 'format')
> >>> C = textscan (fid, 'format', N)
> >>> C = textscan (fid, 'format', 'param', value)
> >>> C = textscan (fid, 'format', N, 'param', value)
> >>> C = textscan (str, ...)
> >>> [C, position] = textscan (...)
> >>>
> >>> If you don't require the input "N", it should be straight forward to
> >>> modify scantext() to implement textscan(). A quick fix would support the
> >>> limited syntax below.
> >>>
> >>> C = textscan (fid, 'format')
> >>> C = textscan (fid, 'format', 'param', value)
> >>> C = textscan (str, ...)
> >>>
> >>> Would that be useful to you?
> >>>
> >>> Ben
> >>
> >> Ben,
> >>
> >> thanks for the quick response.
> >> It would be more useful, if it would also allow the input parameter N.
> >>
> >> regards,
> >
> > Ok. Can you provide a simple example with both an input file and a script
> > that uses textscan() with the parameter N to read some data?
> >
> > Ben
>
> I found some simple examples on the web, and made an attempt at implementing
> the function.
>
> I'd appreciate it if you can try the attached textscan.m and let us know if
> it works for you.
>
> Ben
>
>
>
>
>
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave