Solved

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

Posted on 2007-03-19
3
1,042 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 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

This guide whil teach how to setup live replication (database mirroring) on 2 servers for backup or other purposes. In our example situation we have this network schema (see atachment). We need to replicate EVERY executed SQL query on server 1 to…
Creating and Managing Databases with phpMyAdmin in cPanel.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

808 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