LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 09-19-2005, 07:41 AM   #1
nitroid
Member
 
Registered: Jul 2004
Location: Finland
Distribution: Arch and Maemo (N900)
Posts: 32

Rep: Reputation: 15
Converting Excel-spreadsheets into MySQL databases


I need a way to convert a bunch of Excel spreadsheets into MySQL database form, and only found non-free Windows programs for that. And of course i need it for Linux.

Any suggestions? Preferably something that works without a GUI.
 
Old 09-19-2005, 09:03 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,152

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
A quick search didn't find anything usefull.
My first thought would be to convert the spreadsheets to a csv file.
Create a bash script to create a table and import.
http://dev.mysql.com/doc/mysql/en/mysqlimport.html
 
Old 09-19-2005, 10:02 AM   #3
nitroid
Member
 
Registered: Jul 2004
Location: Finland
Distribution: Arch and Maemo (N900)
Posts: 32

Original Poster
Rep: Reputation: 15
That sounds like an option, michaelk. But now i also need a script that converts Excel spreadsheets into CSV format

The thing is I need a way to make it happen via a web interface on my server, without having to use a spreadsheet program or anything else than a command line app or a script.
 
Old 09-19-2005, 07:27 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,152

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Quote:
The thing is I need a way to make it happen via a web interface on my server, without having to use a spreadsheet program or anything else than a command line app or a script.
This requires a little more thinking....
 
Old 09-19-2005, 07:37 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,152

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
I found this website that might show some promise.
There are c and perl programs for reading an Excel file which you could use to write an application to create a CSV or input directly to mysql.
http://chicago.sourceforge.net/devel/docs/excel/
 
Old 09-20-2005, 06:34 AM   #6
nitroid
Member
 
Registered: Jul 2004
Location: Finland
Distribution: Arch and Maemo (N900)
Posts: 32

Original Poster
Rep: Reputation: 15
Thanks, that looks really promising. I don't think this is going to be easy since I can't really code much, but this will get me started with both the project I'm working on and learning to code. Good thing I'm not in a hurry with making this work.

This doesn't mean I'm not open for further - and possibly easier - suggestions
 
Old 09-20-2005, 06:55 AM   #7
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,973

Rep: Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343Reputation: 1343
Openoffice can directly save a .xls file into csv format (I think that excel can do this also).
Just hit "Save as..." and select the csv format. There you can specify the field delimiter and you're done.
Then run "mysqlimport -c ..." to import the data in a database you've created.
 
Old 04-03-2006, 06:52 AM   #8
Melsync
Member
 
Registered: Sep 2005
Posts: 75

Rep: Reputation: 15
have you tried

has anyone tried this perl script at sourceforge or any other alternative?
Thanks
 
  


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
Restoring Mysql Databases davethegenius Linux - Software 2 08-05-2005 03:01 PM
Comparing two MySQL Databases WeNdeL Linux - Software 1 09-30-2003 04:47 PM
mySQL and excel spreadsheet zuessh Linux - Software 1 06-12-2003 08:26 AM
restoring mysql databases? and mysql permissions... armegeden Linux - Software 0 03-13-2003 12:04 PM
mysql databases k3v0 Linux - Software 2 12-03-2002 08:41 PM


All times are GMT -5. The time now is 09:10 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration