Re: Changing String to Real
- To: mathgroup at smc.vnet.net
- Subject: [mg41033] Re: Changing String to Real
- From: Jens-Peer Kuska <kuska at informatik.uni-leipzig.de>
- Date: Wed, 30 Apr 2003 04:18:59 -0400 (EDT)
- Organization: Universitaet Leipzig
- References: <b8lhn5$9e3$1@smc.vnet.net>
- Reply-to: kuska at informatik.uni-leipzig.de
- Sender: owner-wri-mathgroup at wolfram.com
Hi,
str = "Uoc:0.752"
and
$valid = Join[Characters["1234567890"], {"+", "-", "."}]
ToExpression @StringJoin @@ Select[Characters[str], MemberQ[$valid, #]
&]
??
Regards
Jens
Uli Wuerfel wrote:
>
> Hi there,
> we import a data file and want to extract a number from a string like
> e.g. Uoc:0.752
> Of course we can extract 0.752 with Stringtake but we need to calculate
> with this number. How can we make Mathematica to understand it as a real
> number??
> Thank you for any kind of help,
> Uli