Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: textread/textscan not reading formatted text with whitespace
Replies: 19   Last Post: Oct 22, 2013 5:13 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
dpb

Posts: 8,100
Registered: 6/7/07
Re: textread/textscan not reading formatted text with whitespace
Posted: Oct 22, 2013 5:11 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 10/22/2013 2:56 PM, Norbert Marwan wrote:
> dpb <none@non.net> wrote in message <l462ri$s24$1@speranza.aioe.org>...
...

>> Actually, I don't see why the regexp() folderol...with fixed-width
>> fields simplest and quickest would be to simply insert the comma in
>> the appropriate columns w/ strrep() or similar direct manipulation.
>> Looks like complexity for the sake of showing cleverness???
>>

...

> because it is much slower for long data files with ten-thousends of
> lines. the from the support suggested solution is much faster, but not
> as fast as textread can be.


You're saying the above regexp() solution is faster than

strrep(s(:,4),s(:,4),[s(:,4 ','])

or

[s(:,4) char(ones(3,1)*',') ... ]

where the comma column is predefined? That's surprising.

> i wonder why the '(....)(..)(..)(...)(...)' is not applicable to
> textread or textscan. this would also help. but noooo, this would be too
> simple.


Because it isn't at all related to C i/o format scanning; regular
expressions are their own thing independent thereof. That part I do
understand fully; it would be, imo, _a_bad_thing_ (tm) to try to fold
them together adding generally unwanted complexity to the most mundane
as a cost.

The answer is that there really should be another class of i/o functions
that _are_ based on the FORMAT scanning instead of C-like fscanf() and
friends.

That one, unfortunately, just doesn't look like it's ever going to
happen outside the File Exchange, perhaps, by someone younger (or at
least more energetic) than I am any longer...

--



Date Subject Author
10/2/13
Read textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
Derek Goring
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/3/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/3/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/2/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/3/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/3/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
Norbert Marwan
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb
10/22/13
Read Re: textread/textscan not reading formatted text with whitespace
dpb

Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.