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,088
Registered: 6/7/07
Re: textread/textscan not reading formatted text with whitespace
Posted: Oct 3, 2013 4:49 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 10/3/2013 2:29 PM, Norbert Marwan wrote:
> Hi all,
>
> at least Octave is able to work correctly! Not at a first try, but when
> I redefine the whitespace to be empty, the delimiter to be something
> different than space (e.g. as comma), and use on %s as an output, it is
> working as I wish!
>
> [s y m d] =
> textread('test.txt','%4s%4.0f%2.0f%2.0f','delimiter',',','whitespace','');
>
> The octave help for textread gave me the crucial hint:
>
> Unless whitespace is set to " (empty) AND
> at least one "%s" format conversion specifier is supplied, a
> space is always part of whitespace.
>
>
> Otave finally shows that it is possible to have such workaround!
> Best
> NM


Although what if one doesn't have a string portion of the input record
to treat as a %s? That seems like an artificial and potentially fatal
limitation.

_Possible_ I don't think has ever been the argument... :)

Convincing TMW to make it has been less successful. :(
(Altho as noted above and in the other subthread for potential
performance reasons even I'm not convinced doing it in the existing
functions is the best way to handle it even though I'm sure it could be
made to work.)

--


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.