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: textscan: handling spaces in fixed-width data
Replies: 5   Last Post: Jan 7, 2013 10:36 AM

Advanced Search

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

Posts: 7,881
Registered: 6/7/07
Re: textscan: handling spaces in fixed-width data
Posted: Jan 3, 2013 2:16 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/3/2013 9:08 AM, dpb wrote:
...

> ... or read as
> character and do a mass substitution of the blank w/ another character
> that won't be silently eaten no matter what...
>
> Sotoo
>
> str=strrep(myString,' ','b');
> b = textscan('%1d','TreatAsEmpty','b');


of course.
b = textscan(str,'%1d','TreatAsEmpty','b');

Or, one can dispense w/ the temporary if desired as well

b = textscan(strrep(myString,' ','b'),'%1d','TreatAsEmpty','b');


...

> I don't know what TMW won't take this on as a challenge...

"why", not "what"

--




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.