[thelist] excel migration to database

Peter Smulders schmolle at pobox.com
Tue Oct 14 16:12:22 CDT 2003


Hi Sean,

> I am migrating several hundred excel spreadsheets to MySQL, a time 
> consuming process. Is anyone aware of a tool where I can batch save
> all of the sheets as tab delimited files?

(note that I am making no assumptions about what skills you have or have
available to you; I am just focusing on what I think is a workable solution)

- Use Excel VBA to create a macro, saved in a Workbook of its own.
- Have this macro present a 'Open File' dialog box to ask for the source
Workbooks you want to process. These things accept multiple files.
- The (pseudo code) algorithm for the macro can be this (straightforward
if you know it can be done...):

For each Workbook [ in a list/array returned by the dialog box ]
	Open Workbook
	For each Worksheet
		save as CSV file, named Workbook.Name-Worksheet.Name
	Close Workbook

(yes, it is that simple; the actual VBA will be maybe twice as many lines)

I don't know anything about the layour of the data on the specific
sheets, or through the workbooks to provide you with useful working
code, but I am more than happy to help out if you are still working on
this--contact me off-list.

hth,

Schmolle

(who strongly dislikes what MS sells as technology, but just happens to
know how to use it :)



More information about the thelist mailing list