in reply to Re: Re: From excel to mysql...
in thread From excel to mysql...
Welcome to the non M$ world ;-) The is a substantial upside to not rotating around the GUI.
Anyway with empty fields yes it *should* still work. Excel dumps empty fields as
field1\t\tfield3\tfield4
So when mysql splits on \t you get an undef (NULL) value. In that case add "default 'blah'" to the create ie:
timestamp date default '1970-01-01', joker char(32) default 'anon',
and mysql will fill in the blanks.
If your data is really dirty you may wish to parse the tab sep file with perl, check for whatever then write out all the clean data to a fresh tab sep file before you import. You could flag the errors, write them to a tab sep file and then open and fix it in Excel or just automate it.
One thing to be aware of is that you probably will want a primary key on id (so id must be not null and must also be unique). The other key/index options you will probably want is an INDEX on some/all of the other fields depending on how you plan to search it.
cheers
tachyon
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: From excel to mysql...
by disciple (Pilgrim) on Apr 13, 2004 at 18:51 UTC | |
|
Re: Re: Re: Re: From excel to mysql...
by kiat (Vicar) on Apr 13, 2004 at 15:36 UTC |