LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 06: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, 08:03 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 09: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, 06:27 PM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 06:37 PM   #5
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,700

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
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, 05: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, 05:55 AM   #7
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
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, 05: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



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:02 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