0

I have used the same CSV file for almost a year without any issues when I import it. The last time it imported correctly was on December the 5th. Since that time when I have imported my CSV file it ignores commas beginning on the second row; it will actually include the commas in the first column.

Here is a link to some screenshots I took to show you - you will have to move through all 4 images. https://i.stack.imgur.com/UE3PC.png

Image 1: shows the CSV file when opened with Excel
Image 2: shows the CSV file when opened in Notepad
Image 3: shows what the table looks like after I import it. You can see beginning with store7 it contains the comma in the field then it adds the next column, another comma, and then part of the next column. It then moves on to the next column and will insert everything correctly until it gets back to the first column again. There are a total of 66 entries and only the first one inserts correctly, all of the remaining ones string together the first 2 or 3 columns.

Image 4: shows the import rules I set when importing - these are the default settings. I do this import every day and it has always worked, but stopped working after December 5th.

Bruce BanEm
  • 57
  • 1
  • 7
  • Can you upload the csv somewhere if its not sensitive data, I`ll test it on my machine.Maybe even edit your question with the generated LOAD DATA INFILE.Have you upgraded phpmyadmin or mysql on the 5th? – Mihai Dec 11 '14 at 18:16
  • I removed all of the extra rows except for 2 and it will now display how the query looks: http://i.imgur.com/exad4Mu.jpg I haven't done any updates to MySQL or PHPAdmin Version information: 4.3.0 MySQL Version 5.0.11. It's like it just ignores the comma now in the first field until it reaches the character limit for that field. – Bruce BanEm Dec 11 '14 at 19:29
  • 1
    Try to do it manually to make sure its not a phpmyadmin issue http://stackoverflow.com/questions/14127529/mysql-import-data-from-csv-using-load-data-infile – Mihai Dec 11 '14 at 19:37
  • Alright so when I choose import and I select my CSV file, the import format automatically defaults to CSV. I have always used the default setting and it has worked fine until the past few days. So I changed it to CSV using LOAD DATA and changed the default columns separated with ";" to "," and it imported perfectly. I still wish I knew why it used to work using CSV format but now is only working when I use CSV using LOAD DATA. – Bruce BanEm Dec 12 '14 at 16:39
  • 1
    phpmyadmin is a buggy POS,use a modern client like http://www.heidisql.com/ – Mihai Dec 12 '14 at 16:40
  • 1
    I'll just leave this here which explains the difference between CSV and CSV using LOAD DATA. Seems when you choose the CSV format option, it is uploaded into phpmyadmin and then phpmyadmin parses it out- which must be where the error occurs- just like you said. Thanks Mihai. http://stackoverflow.com/questions/4819169/difference-between-csv-import-and-csv-using-load-data – Bruce BanEm Dec 12 '14 at 17:10

0 Answers0