Quantcast
Channel: MATLAB Central Newsreader Recent Posts
Viewing all articles
Browse latest Browse all 19628

Re: textscan with numeric empty fields

$
0
0
On 8/9/2013 5:23 PM, dpb wrote:
...

> The really bizarre shortcoming is that even the ' t' subfield
> fails--when C wants '%2s' it damn'd well just better be two characters
> and even if 'delimiter','none' is in effect internally it still thinks a
> leading blank is whitespace and ignores it so the conversion on the
> field fails. It's truly hopeless.... :( How C ended up w/ such an
> abomination is amazing when the Fortran model of how to do it right was
> already some 30-yr in existence.

Actually, on further testing and more detailed looking at results, it's
that it craps on the first empty float and then stops...

l =
ss gg67 t
 >> textscan(l,fmt,'delimiter','none')
ans =
   {1x1 cell} [0x1 double] {0x1 cell} [0x1 double] {0x1 cell}
 >> [~,n]=textscan(l,fmt,'delimiter','none')
n =
      4

How 'bout adding to my voice in the wilderness and submit an enhancement
request to TMW to implement a parallel-universe Fortran-like i/o
functions that use FORMAT statement semantics and follow those rules but
vectorized as are the C-like functions of today? I'd settle for just a
parallel of textread() w/ the enhancements of textscan or even a
textscan workalike (altho I detest the loss of return arrays directly w/
its insistence on cell arrays).

The advantages to tout include just for the two obvious from this thread...

a) fixed field-width parsing,
b) incorporation of repeat specifier w/o the folderol of repmat(),

Viewing all articles
Browse latest Browse all 19628

Trending Articles