MathGroup Archive 1999

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

Search the Archive

RE: ReadList


James l. Fisher wrote:
-----------------------
I want to read the following data which is in ascii form into a list 

09/22/98 12:15 2.36
09/22/98 12:30 2.37
09/22/98 12:45 2.38
 

 How can I use ReadList, or some other command, to enter this into the form

 {{09/22/98,12:15,2.36},{09/22/98,12:30,2.37},{09/22/98,12:45, 2.38}}

How could I read each column into a seperate list also.

Thanks
James

------------------------

You can use Import (Version 4.0 only). 

In[1]:=
MyData=Import["data.txt","Table"];

---------------

With other versions of Mathematica use ReadList.

In[2]:=
MyData=ReadList["data.txt", {Word,Word,Number}];

----------------

I don't know of a way to read the data as columns, and I doubt you could.  I
would read it in using one of the above then use the following:

In[3]:=
Transpose[MyData]

------------------
Regards,
  Ted Ersek
  ersektr at navair.navy.mil


  • Prev by Date: ? Repeated Patterns ?
  • Next by Date: Re: Dialog boxes
  • Previous by thread: ReadList
  • Next by thread: Re: ReadList