Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1999
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1999

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

Search the Archive

RE: ReadList

  • To: mathgroup at smc.vnet.net
  • Subject: [mg18850] RE: [mg18787] ReadList
  • From: "Ersek, Ted R" <ErsekTR at navair.navy.mil>
  • Date: Thu, 22 Jul 1999 22:57:48 -0400
  • Sender: owner-wri-mathgroup at wolfram.com

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