LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-16-2014, 03:32 PM   #1
listenerit
LQ Newbie
 
Registered: Feb 2014
Posts: 1

Rep: Reputation: Disabled
MySQL query output to excel file using perl script


Hi Everyone,

Please help me in writing a perl script which would connect to MySQL database and execute a query and export the MySQL query output to an excel file with correct rows and columns.

Thank you Listener
 
Old 02-16-2014, 05:00 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,986

Rep: Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447Reputation: 2447
that would be a MICROSOFT OFFICE excel file *.xlsx

For starters use a bat file on a Microsoft operating system

but for a normal everyday CSV file that can be done many different ways

Last edited by John VV; 02-16-2014 at 05:02 PM.
 
Old 02-17-2014, 01:06 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,260

Rep: Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328Reputation: 2328
We'd quite like to see what you've done so far ...
That being said, as above, '.csv' is the usual portable way to handle this.

However, if you really want to go direct to the correct Excel format, try search.cpan.org to find a '.pm' (Perl module).
It's probably there ... somewhere, but it may be a bit fiddly.

Personally I'd use '.csv'
 
Old 02-17-2014, 03:35 AM   #4
pan64
LQ Guru
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 8,508

Rep: Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434Reputation: 2434
as far as I remember excel has an odbc interface therefore it can directly read mysql database. Why do you need perl?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to copy Arabic data from excel fiel to another excel file in PERL? David the H. Linux - Newbie 0 04-23-2012 10:24 AM
[SOLVED] perl script output cannot pipe to file hattori.hanzo Programming 3 12-15-2010 03:26 AM
send output of mysql query to email within same script hattori.hanzo Linux - Newbie 2 12-03-2008 04:14 AM
Perl script/mysql select query from a file mcdrr Programming 12 06-05-2007 01:00 AM


All times are GMT -5. The time now is 06:08 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration