You will have to create the table first
make sure you have the same number of fields in your table as in your file
Otherwise specify the column names in brackets at the end of the LOAD DATA
statement
then 

LOAD DATA INFILE 'list.csv'
INTO TABLE yourtable
FIELDS TERMINATED BY ','
OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n';

This should work I guess
-----Original Message-----
From: Chris L. Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 10:36 AM
To: Roger Karnouk
Cc: [EMAIL PROTECTED]
Subject: Re: Importing spreadsheet data into MySQL


Thanks for the response... let's say that I save the CSV as "list.csv" in my
computer as "C:/programs/list.csv". What would the full syntax be? I have
tried some variations and they do not work. Also, and this may be the king
of newbie questions, will MySQL create tables based on my information or do
I need to have a table built to house the data BEFORE I import?

Chris Gray
----- Original Message -----
From: "Roger Karnouk" <[EMAIL PROTECTED]>
To: "Chris L. Gray" <[EMAIL PROTECTED]>
Sent: Wednesday, June 06, 2001 9:36 AM
Subject: RE: Importing spreadsheet data into MySQL


Using Excel you can save that data in CSV from
then use LOAD DATA INFILE syntax to import it to a MySQL table.



-----Original Message-----
From: Chris L. Gray [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, June 06, 2001 9:15 AM
To: [EMAIL PROTECTED]
Subject: Importing spreadsheet data into MySQL


Is it possible to import spreadsheet data (Excel) into MySQL? I have data on
about 2,500 retail locations that I must place into a database on the web
and I do not want to type them by hand if I can avoid it.

Thanks,

Chris Gray


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.256 / Virus Database: 129 - Release Date: 5/31/2001


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to