MathGroup Archive 1997

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

Search the Archive

Re: Converting Excel table to Mathematica matrix.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg8221] Re: Converting Excel table to Mathematica matrix.
  • From: jason at pernet.com (Jason Welter)
  • Date: Tue, 19 Aug 1997 21:12:00 -0400
  • Organization: MindSpring Enterprises
  • Sender: owner-wri-mathgroup at wolfram.com

On 12 Aug 1997 01:58:10 -0400, eestevez at lander.es (Elvis Pelvis)
wrote:

>How to I convert an Excel mxn table into a Mathematica mxn matrix?


I do this dozens of times a week.

1.  Save the table as a comma delimited file.

2.  Read the file in using data =
ReadList["FileName",{Number,Number,Word,Word},NullWords->True];

I prefer to specify m columns in my list "{Number,Number,Word,Word}"
to tell Mathematica what each is.  I treat dates and times as Words.
If I want to plot dates vs. the data, I change the format of the dates
column in the spreadsheet to be just integers and give Mathematica a
list of numbers and their date strings to plot as labels.  I have the
notebook at work.  Write me if you want the details.

Use "NullWords ->True" if there will be cells in your spreadsheet that
are empty.

Due to the power of ReadList there are many different ways to
accomplish any given task.  Some may be more eligant than others.

PS.  Numbers like "1,234" are a mistake using my approach.  Reformat
numbers to look like "1234".


  • Prev by Date: Re: Sorting Eigenvalues/EigenVectors
  • Next by Date: Re: Sorting Eigenvalues/EigenVectors
  • Previous by thread: Re: Converting Excel table to Mathematica matrix.
  • Next by thread: Parameter estimation with mathematica