MathGroup Archive 2005

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

Search the Archive

Re: Outputing a tabular function

  • To: mathgroup at
  • Subject: [mg54966] Re: Outputing a tabular function
  • From: Bill Rowe <readnewsciv at>
  • Date: Tue, 8 Mar 2005 05:03:53 -0500 (EST)
  • Sender: owner-wri-mathgroup at

On 3/7/05 at 2:10 AM, camartin at (Clifford Martin) wrote:

>In some code I've written I output a table. In Mathematica I use
>TableForm in the usual way then use columns of data to fill the table. 

Your wording here implies you create something with TableForm and then change it. I can think of no simple obvious way to change the output of TableForm. So, it is a bit unclear to me what your end table looks like.

>It looks nice in Mathematica. But my customer wants to be able to pull
>the file up in Excel. I've tried various export formats but since the
>tables are made up of columns of data that are just lists it writes
>the lists as rows Any suggestions about exporting the data so it can
>be read in an external program and look like a table? 

It would have been useful had you said specfically what you've tried and what you found wanting. If you are usign version 5.1, Export can create a native Excel file. That is

Export["test.xls", Table[i + 10 j, {i,5},{j,5}], "XLS"]

will create a spread sheet with a 5 x 5 array. If the data structure has more than 2 dimensions, i.e.,Table[i + 10 j, {i,5},{j,5}, {k,3}], the resulting Excel file will have multiple sheets with data.

For versions before 5.1 that also had the Export function, I've found the best way to get data into an Excel spread sheet is to to export to either "CSV" or "TSV" formats. If your customer is using Windows, I think you can do

Export["test.xls", Table[i + 10 j, {i,5},{j,5}], "TSV"]

and you will get a file that will open as you want in Excel when double clicked.

>(I should add that I iterate over many sets of data and so there are
>multiple tables that print out. I capture the data in a function that
>I try to Export). Any suggestions appreciated.
To reply via email subtract one hundred and four

  • Prev by Date: Re: repeating elements in a list
  • Next by Date: Re: Help on iteration
  • Previous by thread: Re: Outputing a tabular function
  • Next by thread: Re: Outputing a tabular function