MathGroup Archive 2004

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: how to take quotation marks away ?


"Florian Jaccard" <florian.jaccard at eiaj.ch> schrieb im Newsbeitrag
news:c9k3op$fe7$1 at smc.vnet.net...
> Dear Mathematica-specialists,
>
>
>
> I have a  (long)  list of the form   {{"42.1,3.3"},{"3.1,4.2"}}
>
> How can I transform it to obtain  {{42.1,3.3},{3.1,4.2}} ?
>
> I tried ToExpression, but it failed.
>
>
>
> Thanks in advance !
>
>
>
> Greetings
>
>
>
> F.Jaccard
>
>
Florian,
transform each list containing one string s to a string "{"<>s<>"}" and
apply ToExpression:

data = {{"42.1,3.3"}, {"3.1,4.2"}};
val = ToExpression[ToString[#]] & /@ data
   {{42.1, 3.3}, {3.1, 4.2}}


Map[Head, val, {-1}]
   {{Real, Real}, {Real, Real}}

-- 
Peter Pein, Berlin
to write to me, start the subject with [




  • Prev by Date: DICOM-RT
  • Next by Date: Problem with formula template completion
  • Previous by thread: RE: how to take quotation marks away ?
  • Next by thread: Re: how to take quotation marks away ?