Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.