Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

Re: String to numbers

  • To: mathgroup at
  • Subject: [mg55360] Re: String to numbers
  • From: Bill Rowe <readnewsciv at>
  • Date: Sun, 20 Mar 2005 04:11:52 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 3/19/05 at 4:46 AM, jerb at (Erb, John) wrote:

>I have data in file in the form of strings, formatted as:
><2.54   3.11   2.89>
><3.58   5.24   5.66> .... more

>How can I read this into mathematica, and convert the strings to
>numbers, so I would have


The following should do the trick

ToExpression/@ReadList[filename, Word, 
   RecordLists -> True, RecordSeparators -> {{"<"}, {">\n"}}]

Note, this assumes none of the numbers are formatted as




While ToExpression will convert these to an expression, it will not be what you are expecting.

To reply via email subtract one hundred and four

  • Prev by Date: Re: String to numbers
  • Next by Date: Re: filling in an array
  • Previous by thread: Re: String to numbers
  • Next by thread: Re: String to numbers