Re: Mathematica - convert engineering form to numeric data



On Sep 28, 1:48 pm, "Dave (from the UK)" <see-my-signat...@see-
below.com> wrote:
Richard J. Fateman wrote:

aEb does not mean a*10^b in Mathematica. Try a*^b .

Or use a CAS other than Mathematica.
RJF

I don't recall ever saying aEb meant a*10^b in Mathematica.

But -1.185637512E+002 in my data file does mean -1.185637512 x 10^2, or
-118.5637512.

Mathematica was not used to produce the data file. I want to read the
file in Mathematica, and somehow get Mathematica to know this is to be
interpreted as a*10^b. I can't belive there is not a function for doing
this, as I would expect others to have data files with this format too.
Otherwise, perhaps replacing "E" by 10^ will do. But that seems a bit of
a hack, but perhaps it is the best way.

--
Dave (from the UK)

Please note my email address changes periodically to avoid spam.
It is always of the form: month-y...@xxxxxxxxxxxx
Hitting reply will work for a few months only - later set it manually.

http://chessdb.sourceforge.net/- a Free open-source Chess Database


I think the example below is along the lines you want.

In[4]:= !cat /home/usr2/danl/values.dat
07:35:39 -1.185637512E+002 123.E-1
1.24375 5

In[6]:= InputForm[vals= Import["values.dat", "Table"]]

Out[6]//InputForm= {{"07:35:39", -118.5637512, 12.3}, {1.24375, 5}}

From here it should be straightforward to do the sort of extraction
you have in mind.

By the way, I got the setting right from the documentation tutorial on
Import/Export.

tutorial/ImportingAndExportingFiles

Daniel Lichtblau
Wolfram Research

.



Relevant Pages

  • Re: Mathematica - convert engineering form to numeric data
    ... Richard J. Fateman wrote: ... Or use a CAS other than Mathematica. ... Mathematica was not used to produce the data file. ...
    (sci.math.symbolic)
  • Re: Is zero even or odd?
    ... and at least one by Texas Instruments that I can recall. ... >>Likewise Maple and MATLAB (but not Mathematica). ...
    (comp.lang.perl.misc)
  • Re: Is zero even or odd?
    ... and at least one by Texas Instruments that I can recall. ... >>Likewise Maple and MATLAB (but not Mathematica). ...
    (sci.math)
  • Re: Is zero even or odd?
    ... and at least one by Texas Instruments that I can recall. ... >>Likewise Maple and MATLAB (but not Mathematica). ...
    (sci.electronics.design)
  • Re: Is zero even or odd?
    ... and at least one by Texas Instruments that I can recall. ... >>Likewise Maple and MATLAB (but not Mathematica). ...
    (sci.physics)