Search code examples
mysqlsqlinto-outfile

MySQL: select into .XLS outfile vertically/targeting specific cells


I'm trying to output one or two rows at a time from MySQL into an XLS spreadsheet, but Ideally I want it to be vertically, and I want to include the same user defined data alongside each one.

It should end up looking like this:

Name:  Bobby
Surname: Robson
Favorite food: Chips

Etc. I'd also ideally like to include a second set of two columns. Is this possible?


Solution

  • There is a Python package called pyExcelerator that can export MySQL data to Excel via Python script. MySQL itself doesn't output in Excel binary format though.


    EDIT: Based on the OP's comment, here is a Perl module for writing Excel spreadsheets. Presumably, there exists Perl support for MySQL already ;)