The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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 ]

Posts: 9,850
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.