LOAD DATA LOCAL INFILE 'path-to-file/file.csv' INTO TABLE table FIELD TERMINATED BY ',' OPTIONALLY ENCLOSED BY """" LINES TERMINATED BY '\n' (field1, field2, field3, .... );
ovviamente vanno cambiati i delimitatori di campo (FIELD TERMINATED BY) e la delimitazione del testo (OPTIONALLY ENCLOSED BY).
Eventualmente (file creati sotto windows) bisogna aggiungere il solito \r al fine riga (LINES TERMINATED BY ‘\r\n’).
0 Responses
Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.