• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 644
  • Last Modified:

Trouble import csv into MYSQL

I keep getting an Invalid Column count on line 1 when I try to import data into MYSQL into an existing table.  I know there are the correct number of columns.  If I escape the lines with \r the data will import, but it will add \r to the last column so that in the database the data shows up as full_html\r instead of full_html

not sure what I am doing wrong but I have attached a sample of the data  that i am trying to import.  Any help would be hugely appreciated.  Not sure if it makes a difference but I am on a mac. Been working on this for days with no luck.
0
kmurphychi
Asked:
kmurphychi
  • 3
  • 3
1 Solution
 
Garry GlendownConsulting and Network/Security SpecialistCommented:
no attachment that I can see ... !?
0
 
Julian HansenCommented:
What are you importing with

Custom PHP Script
PHPMyAdmin
SQLYog

?
0
 
kmurphychiAuthor Commented:
That's weird.  I thought it attached.  Here it is.  Thanks!
sampleimportdataL.csv
0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
kmurphychiAuthor Commented:
I'm importing through PHPMyAdmin.
0
 
Julian HansenCommented:
Have you tried removing the extra ',' at the end of each line?

This is telling the import routine there is an extra field at the end that is not there

Without your table def can't verify but that is the most likely cause
0
 
kmurphychiAuthor Commented:
THANK YOU!!!!!  Removing the extra , worked like a charm!
0
 
Julian HansenCommented:
Excellent! Glad to help.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now