Solved

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

Posted on 2007-03-19
3
1,046 Views
Last Modified: 2009-12-16
How to bulk insert data from cvs file into MySQL database?
0
Comment
Question by:ztot
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 143

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 143

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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Foreword In the years since this article was written, numerous hacking attacks have targeted password-protected web sites.  The storage of client passwords has become a subject of much discussion, some of it useful and some of it misguided.  Of cou…
This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

632 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