Getting Invalid column count in CSV input on line 1 error - mysql

I'm trying to export a CSV from my client's FluidSurvey's account and import it into a database I've created. I've never actually worked with a CSV before, so excuse my ignorance.
I've looked into this error and none of the solutions seem to be working for me, I'm at a loss, I've been trying to import this file for hours now.
Settings are as follows:
There is already a table with columns for this data to be inserted into.
What am I missing here?

You've showed exported csv file in Excel or Calc. It is impossible to understand how you columns are enclosed. Probably there is some sign other than ' or " Please show exported csv in notepad. This will clear the structure of csv.

I found that Fluidsurveys CSV files had the header two bytes incorrect.
They are only 7F7E. Changing them to the expected Unicode FFFE works as expected - they can be read into Excel with no garbage characters at the start.

Related

Why aren't my functions working as expected in MySQL?

I am trying to figure out why MYSQL isn't working as expected.
I imported my data from a CSV into a table called Products, which is shown in the screenshot. It's a small table of just ID and Name.
But when I run the where clause, finding out where the Name = 'SMS', it returns nothing? I don't understand what the issue is.
My CSV contents in Notepad++ is shown below:
This is what I used to load in my CSV, if there are any errors here.
Could you share your csv file content?
It's happened to me too before, and the problem is because there's some blank space in the data in csv file.
So maybe you could parse first your csv file data (remove the "not needed" blank space) before import it to database
This is often caused by spaces or look-alike characters. If caused by spaces or invisible characters at the beginning/end, you can try:
where name like '%SMS%'
You can then make this more general:
where name like '%S%M%S%'
When you get a match, you'll need to do more investigate to find the actual cause.

Invalid column count in CSV input on line 1 error (Already checked other questions)

So I've seen this question asked many times but I have not found an answer to my issue. I'm using phpmyadmin, I have 1 table with 2 columns and I have a .csv with 2 columns. My csv does not have headers and my columns are separated by ";", already changed it in phpmyadmin to "Columns separated with ;", but I still got the same error. Can anyone help?
edit: I'm using the "Import" option of phpMyAdmin to import my csv
edit2: So I decided to export my table to see how the csv was generated. It exports like this:
"1", "1001"
"2", "1002"
Do you know why? or how can I create an csv file with the same format?
export table
As it says in the manual
When importing data into a table from a CSV file where the table has an ‘auto_increment’ field, make the ‘auto_increment’ value for each record in the CSV field to be ‘0’ (zero). This allows the ‘auto_increment’ field to populate correctly.
see https://docs.phpmyadmin.net/en/latest/import_export.html
So, what worked for me was: I exported the table as an csv and worked over that. After I was done, I imported this modified csv and it worked. It must've been what nbk said about termination, so I guess in a way that was the answer

phpmyadmin import not inserting numbers correctly from csv

I'm trying to import some data from a CSV into my database with phpmyadmin.
Here's a row from the CSV:
20101,1,grams,Good,AU,0.9999,Caesar,2017-06-14,12:33:44,RP
The first number I have set as a unique bigint(16). Somehow though, this gets imported as "101" instead of "20101", which causes a duplicate error because i already have a "101".
Why wouldn't the number fully read as "20101"?
I think I figured this out. When saving the CSV from Excel, I was using the "CSV (UTF-8)" option. Don't know why that would make a difference, but when I switched to saving it as a plain CSV comma delineated, the file imported with no problems.

import csv utf8 to phpmyadmin [bug]

I am using phpmyadmin(Version : 4.6.4) as a platform to import CSV encoded with UTF-8 to database. I am able to import the data, but with no idea why is the first two character of at first-column first-row went missing and this happens every time i import a CSV.
raw: A1610011111-001,N,N,N,N,N,N,N,N,N,N,N,N,N,--
This is what the data supposed to be -> (A1)
CSV data
This is the imported data (A1 went missing)->imported data
If the data is more than one row, the result will be same(only 1st two character went missing)
I am not sure what is the problem and what is the solution. Please give me a hand on this.
Well for anyone still searching for an answer, this is what worked for me after numerous tries.
In Excel (365), you can chose between
save as csv UTF-8 (sperated by comma's)
save as csv (seperated by delimiter)
As contradictory as it may seem, when I use the first option, I lose my first 2 characters, whereas choosing the 2nd. option I lose nothing.
So saving without the UTF-8 seems to do the trick.

cannot load simple csv file into tableau public 9.3

I am trying to load the following simple csv file into tableau public 9.3:
customers,item1,item2,item3,item4
1,0,0,0,0
2,0,0,0,0
3,0,0,0,0
However, it doesn't read the file as separate columns, despite the field separator being Comma. Instead it treats the whole line as one column. Any help would be greatly appreciated :
If you change your locale settings to English US you will be able to load the file. You should also be able to work around this by creating a schema.ini file.
Go to Data > Manage fields > [Field] Options
You can also control imported CSV behavior post import both by splitting individual columns (which will remain split on update as well), or by the image below at the CSV level.
That doesn`t work for me. So I reopen the .csv file in Excel and save it again in .csv format with ',' as the delimeter.
After that my file looks like .csv with ';' delimeter and works with Tableau.