MathGroup Archive 2002

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

Search the Archive

Re: readin numbers from a file

  • To: mathgroup at smc.vnet.net
  • Subject: [mg34505] Re: [mg34471] readin numbers from a file
  • From: BobHanlon at aol.com
  • Date: Fri, 24 May 2002 02:42:08 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

In a message dated 5/23/02 4:48:48 AM, moreno at alumnos.uva.es writes:

>I'm starting to work with mathematica and i have any problems:
>I have to read numbers from a text file containing numbers and words.
>I want to transform a string to a number,and i'm using ToExpression but
>the problem is that numbers as a string are in format "0.23E+02" and
>mathematica transforms as (0.23*E)+2 with E=2.71828 but I want it to be
>23.
>Anybody kows how i coul do that?
>

ToExpression[StringReplace["0.23E+02", "E"->"*^"]]

23.


Bob Hanlon
Chantilly, VA  USA


  • Prev by Date: PlotLabel with Assigned Variables
  • Next by Date: Complete reference
  • Previous by thread: readin numbers from a file
  • Next by thread: plotting with boundary conditions