Answer the question
In order to leave comments, you need to log in
Import to Mysql from csv. How to do?
Hello! I have such a problem. There is a file in csv format. The first column contains data from 1 column in the db. In the second - from 2 columns, respectively.
Unable to import to database. There, the data must be in quotes and on one line, separated by commas.
Rewriting is not an option. i have 170k rows.
Answer the question
In order to leave comments, you need to log in
As an option, rewrite with a regular expression, or look for something related to separators in mysql
Take any CSV parser from github for your favorite programming language, write a small program that will do all this for you. All this will take 10 minutes.
phpMyAdmin позволяет задать разделители и переносы / окончания строк вручную
170 thousand lines. ?
From experience, I’ll say the parser algorithm in PHP has a chance to die or freeze.
I have a table with 160 thousand rows and 19 columns, the process hung up for 38-40 thousand lines, although the file was processed according to the proven algorithm blog.cinu.pl/2013/08/doctrine2-php-inserting-large...
try using LOAD DATA INFILE so it will be many times faster
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question