Solved

How to bulk insert data from cvs file into MySQL database?

Posted on 2007-03-19
3
1,041 Views
Last Modified: 2009-12-16
How to bulk insert data from cvs file into MySQL database?
0
Comment
Question by:ztot
  • 2
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 18746813
please check out the LOAD DATA INFILE statement from MySQL:
http://dev.mysql.com/doc/refman/5.0/en/load-data.html
0
 

Author Comment

by:ztot
ID: 18746936
Hi thanks for your speedy reply. I have manage to bulk insert the data, however every last field will end with new line (or return carriange).

Example:
Row1.1 Row1.2 Row1.3<new line>
Row2.1 Row2.2 Row2.3<new line>

How to remove the last "new line" command so it will show only Row1.1 Row1.2 Row1.3
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 125 total points
ID: 18746947
did you specify the following option:
LINES TERMINATED BY '\n'

if yes, does the file eventually have '\r\n' or the like... you will have to specify the exact "line terminator" sequence of the file...
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of articles have been written on splitting mysqldump and grabbing the required tables. A long while back, when Shlomi (http://code.openark.org/blog/mysql/on-restoring-a-single-table-from-mysqldump) had suggested a “sed” way, I actually shell …
Introduction In this article, I will by showing a nice little trick for MySQL similar to that of my previous EE Article for SQLite (http://www.sqlite.org/), A SQLite Tidbit: Quick Numbers Table Generation (http://www.experts-exchange.com/A_3570.htm…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now