The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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":


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

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

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

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

Out[39]= -Graphics-

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

Hope it is of assistance



Victoria Steblina Email:
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]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.