At 17:45 -0500 2/29/04, Joshua Beall wrote:
Hi All,

I am wondering if anyone can point me to a utility that will let me dump
the
result of a MySQL query to a file I can open in MS Excel or (preferably)
OpenOffice.org Calc.

phpMyAdmin lets you do this if you want to dump a "SELECT * FROM
<table>",
but if I want to fine tune it I cannot (unless I am missing something)

MySQL CC lets me save the result of a query to a test file "right
click->save results", but this format does not quite conform to either
Excel
or Calc's text format.  I could fix it by hand, but before I would do
that,
I think I would write a PHP script that would generate the right output.

But before I spend any time working on doing that, I am wondering if
anyone
knows of a way to do this already?

I am running MySQL 4.0.12-standard on Mandrake 9.2 on the server, and my
workstation is an XP Pro box.  I use MySQL CC 0.9.1-beta and phpMyAdmin
2.5.0, but am completely willing to upgrade more recent versions of
either
of these tools, or try a new one.

If you're willing to use Perl, you can use the Spreadsheet::ParseExcel::Simple and Spreadsheet::WriteExcel::FromDB modules. An example that shows how to dump a MySQL table in Excel format is in the MySQL Cookbook recipes distribution:

http://www.kitebird.com/mysql-cookbook/

Get the distribution, unpack it, and look in the transfer directory
for the mysql_to_excel.pl script.  The from_excel.pl and to_excel.pl
scripts in the directory convert between Excel and tab-delimited data.
For example, if you dump an arbitrary query result, you can convert
it to a spreadsheet with to_excel.pl.


-- Paul DuBois, MySQL Documentation Team Madison, Wisconsin, USA MySQL AB, www.mysql.com

MySQL Users Conference: April 14-16, 2004
http://www.mysql.com/uc2004/

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to