Jump to content

importing .csv file to mysql table.


Joesavage

Recommended Posts

my phpmyadmin has a simple tool used for importing .csv files, so i thought this would be straight forward. The problem is that the .csv file I am trying to import has sometimes has commas in one of the columns. The .csv file is the maxmind database that is used for finding out what country an IP address is in, it has nearly 1000000 rows, so I cannot go through and take all the commas out by hand, even though this would solve the problem. When I try to import the file every time the import thingy gets a row with a comma in a column it aborts and reports an error.

 

Here are the settings I am using.

 

Fields terminated by: ,

Fields enclosed by: "

Fields escaped by: \

Lines terminated by: \n

 

I am pretty sure if I change this up I can make it import correctly and ignore those commas in the last column. Any suggestions?

Link to comment
https://forums.phpfreaks.com/topic/88157-importing-csv-file-to-mysql-table/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.