[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] MySQL help
I always tend to export CSV using pipes as delimeters, and all output quoted.
It gived guaranteed strings to search for ("|" is fairly unlikely to appear,
too). This is just personal preference, though.
The program mysqlimport, which comes with the mysql client, can read these
easily enough, and is really configurable. It essentially translates CSV
(with any delimiter, terminator, enclosing character, etc) to fields for a
particular set of columns, and inserts it.
HTH
Craig
On Wednesday 24 April 2002 13:17, you exclaimed:
> On Wednesday 24 Apr 2002 12:19 pm, Steve Tickle wrote:
> > I'm trying to populate a MySQL table with data which is actually held in
> > an Excel worksheet. The problem is that when I save the worksheet as a
> > text file some of the data gets out of skew. Is there any other file
> > format I can import the data from, whether by using "load data infile" or
> > any other method?
>
> The format I usually use for such things is CSV (by text, do you mean
> CSV?). CSV is fairly straightforward, but Excel can do silly things with it
> sometimes. If your data has any commas in it they will have to be escaped
> somehow, usually by being in quotes. Quoting and commas are usually the
> things that trip up parsers, some of them are horribly naive. Theres some
> pretty good packages for Perl that read CSV - it shouldn't be too hard to
> write an importer.
> ___________________________________________________________________
>
> Sheffield Linux User's Group -
> http://www.sheflug.co.uk/mailfaq.html
>
> GNU the choice of a complete generation.
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.