LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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, 02: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, 04:00 PM   #2
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
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 04:02 PM.
 
Old 02-17-2014, 12:06 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
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, 02:35 AM   #4
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,918

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


Reply



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 09:24 AM
[SOLVED] perl script output cannot pipe to file hattori.hanzo Programming 3 12-15-2010 02:26 AM
send output of mysql query to email within same script hattori.hanzo Linux - Newbie 2 12-03-2008 03:14 AM
Perl script/mysql select query from a file mcdrr Programming 12 06-05-2007 12:00 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 02:53 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
Open Source Consulting | Domain Registration