Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.math.mathematica

Topic: Re: help! to input data...
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Victoria Steblina

Posts: 18
Registered: 12/7/04
Re: help! to input data...
Posted: Jun 16, 1996 2:27 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

> I thought i was pretty good at the basics of mathematica, but today i
> tried to input some numerical data that was comma delimited. i.e.
>
> 456,-45,21,0,5
> 43,25,3,66,65


Say, this is your input sitting in the file "data":

456,-45,21,0,5
43,25,3,66,65

In[37]:= in1 = OpenRead["data"]

This reads it first as a set of strings and then converts to a single
string:

In[38]:= in2 = ReadList[in1, String] // ToString

Out[38]= {456,-45,21,0,5, 43,25,3,66,65}

This output now looks like a conventional list of numbers but is still
a string. Gotta convert this data string to a list of numbers and check
with
ListPlot:

In[39]:= ListPlot[ ToExpression[in2] ]

Out[39]= -Graphics-

P.S. I just saw Ian Collier replied to this question but decided to
post
it anyway, it is kind of short :)

Hope it is of assistance

Regards,
Vicki

________________________________________________________________________

Victoria Steblina Email: vvs124@rsphy1.anu.edu.au
Optical Sciences Centre Tel: 61 6 249 5129
Australian National University Fax: 61 6 249 5184
Canberra, ACT 0200, Australia







Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.