Re: Wha's up w/ field width in parsing input???
- From: "Oleg Komarov" <oleg.komarovRemove.this@xxxxxxxxxx>
- Date: Wed, 7 Jul 2010 20:24:05 +0000 (UTC)
dpb <none@xxxxxxx> wrote in message <i12mii$vth$1@xxxxxxxxxxxxxxxxxxxxxxxxxx>...
Brought to light in another thread of poster w/ fixed width fields but no delimiter wherein import wizard, etc, failed to parse the empty fields.
Thought should be able to use the width but no; at least w/ my early version and as I read doc on current textscan() probably won't work there, either.
So, is the following
a) broke in early release but fixed now, or
b) wad?
>> s = ' 3 12.5';
>> [x,y,z]=strread(s,'%3d%3d%3.1f',1)
x =
3
y =
12
z =
0.5000
>>
OTOH,
>> [x,y,z]=strread(strrep(s,' ','0'),'%3d%3d%3.1f')
x =
3
y =
1
z =
2.5000
as expected/desired.
So, is there any way to parse the "empty" fields that aren't really empty w/o resorting to somesuch workaround as the above?
And, b) what is actually going on w/ the prior result--it makes no sense to me to get y=12 z=0.5, certainly.
--
I found this problem several times and apparently there is no way to parse empty fields (also confirmed by tech support) !!! I thought it was just my problem but since you bring it to our attention I can confirm that my solution was similar, resorting to replace and textscanning after.
Oleg
.
- Follow-Ups:
- Re: Wha's up w/ field width in parsing input???
- From: Oleg Komarov
- Re: Wha's up w/ field width in parsing input???
- From: dpb
- Re: Wha's up w/ field width in parsing input???
- References:
- Prev by Date: Re: importdata problem
- Next by Date: Can matlab create animations?
- Previous by thread: Wha's up w/ field width in parsing input???
- Next by thread: Re: Wha's up w/ field width in parsing input???
- Index(es):
Relevant Pages
|