MathGroup Archive 2004

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

Search the Archive

Re: how to take quotation marks away ?


Florian Jaccard wrote:
> 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}} ?

Hi Florian,

use ImportString[]:

import[list_]:=Map[ImportString[#,"CSV"]&,list,{2}] // Flatten[#,2]&

{{"42.1,3.3"}, {"3.1,4.2"}} // import

gives:

{{42.1, 3.3}, {3.1, 4.2}}

Regards,
Marcus

-- 
[...] Fasting is a big mistake. Particularly on an empty stomach.
    -- W. Allen


  • Prev by Date: Re: how to take quotation marks away ?
  • Next by Date: Re: Disabling Shadow Errors, XEmacs with Mathematica, coloring
  • Previous by thread: Re: how to take quotation marks away ?
  • Next by thread: Re: how to take quotation marks away ?