Activities

November 2009
M T W T F S S
« Oct   Dec »
 1
2345678
9101112131415
16171819202122
23242526272829
30  

How to import a .CSV to MySQL table

The following example will shows how to import csv file data which is seperated by a comma between the fields. This will useful for contacting any of the third party who will provide their data either in Xml or csv format.

LOAD DATA LOCAL INFILE ‘/home/produser/eA_performance_usd.csv’
INTO TABLE ea_perfomance_usd
FIELDS TERMINATED BY ‘,’
ENCLOSED BY ‘”‘
lines TERMINATED BY ‘n’

a. home/produser/eA_performance_usd.csv = path to the csv file
b. table name here ‘ea_perfomance_usd’
c. colum separator = .

Leave a Reply

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>