Path: news.mathworks.com!newsfeed-00.mathworks.com!oleane.net!oleane!news.ecp.fr!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: String Operations
Date: Sat, 07 Nov 2009 10:57:28 -0600
Organization: A noiseless patient Spider
Lines: 29
Message-ID: <hd48tv$v8q$1@news.eternal-september.org>
References: <hd466l$scb$1@fred.mathworks.com> <hd47i0$jbq$1@news.eternal-september.org> <hd486g$14a$1@fred.mathworks.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX1/wcTXV9yaHqnke53ZGxtC+7i7CgIRujAuJ3VAn0ERXHRK0uu8cUmOic2xoGsR6YjvFGDEHI6GjCpkxuBIQD3AfJa6iDkSNVDXbEQPD14mBADQhaqLSeIAEu5ao6i7N5q0=
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Sat, 7 Nov 2009 16:57:36 +0000 (UTC)
In-Reply-To: <hd486g$14a$1@fred.mathworks.com>
X-Auth-Sender: U2FsdGVkX18FsTkiYs9WDGPhJkisXCxmBlgSvjIBcLY=
Cancel-Lock: sha1:yVU+iXQqEhn5/dd2N8JrGlgRhQs=
User-Agent: Thunderbird 2.0.0.23 (Windows/20090812)
Xref: news.mathworks.com comp.soft-sys.matlab:583238


Wrighty43 Wright wrote:
> dpb <none@non.net> wrote in message <hd47i0$jbq$1@news.eternal-september.org>...
>> Chris Wright wrote:
>> ...
>>> I have lots of strings in the form of (that are being extracted from
>>> an xml file):
>>>
>>> -94%22%-4%92%-9%...
>> ...
>>
>>> any ideas for the best way ??
>> strread(s,'%d','delimiter','%')
>>
>> would at least be one way (no claim for "best" :) )...
>>
...
> thanks that really helps, saves me messing around with sscanf

Yeah, it's handy for cases like this, for certain.

There's bound to be a way to get the stupid C format string to allow you 
to enter a literal percent character as a character-matching character, 
but I don't know just how that would be and it ain't worth futzin' w/ 
trying to figure out how since do have strread()

W/O strread(), I'd probably do a substitution of ' ' for '%' _then_ use 
sscanf() just for the record.

--