Invalid field count in CSV input on line 1

后端 未结 6 1476
孤独总比滥情好
孤独总比滥情好 2021-01-16 14:15

I am trying to export an ODS file to CSV, but when I import into phpmyadmin - I get \"Invalid field count in CSV input on line 1.\"

File (it has more than two lines

相关标签:
6条回答
  • 2021-01-16 14:28

    Make sure your uploading csv file only not excel file and then follow the below steps

    1 Import

    2 Browse for your csv file.

    3 Select CSV using LOAD DATA (rather than just CSV)

    4 Change “Fields terminated by” from “;” to “,”

    5 Make sure “Use LOCAL keyword” is selected.

    Click “Go”
    
    0 讨论(0)
  • 2021-01-16 14:29

    If you use phpMyAdmin, then you are allowed to specify column names. When logged into the desired database:

    1. Select the table you want to import to.
    2. Click the Import tab.
    3. Under Format of imported file, select CSV.
    4. In Column names, write out a comma separated list of the columns you want the data imported to.

    You can also use mysqlimport if you prefer the shell.

    For Example:

    shell>mysqlimport --columns=column1,column2 dbname imptest.txt
    
    0 讨论(0)
  • 2021-01-16 14:31

    In Excel I saved the file as "Microsoft Office Excel Comma Separated Values File (.csv)"

    In Phpmyadmin:

    1. Select database you want to import table into.
    2. Click import tab.
    3. Select your file. Set FORMAT to CSV
    4. Leave Format-Specific Options alone except for ticking the "The first line of the file contains the table column names" box if you need to
    5. Click GO
    6. You then need to rename the table ( which will be called somthing like "TABLE 5" if its the 5th table in the DB). So select the table and using the Operations tab -> "Rename table to:"
    0 讨论(0)
  • 2021-01-16 14:37
    1. Go to Import tab

    2. Browse for the csv file.

    3. Select "CSV" on Format on imported file tab

    4. Checklist the "Ignore duplicate rows"

    5. Change “Fields terminated by” from “;” to “,”

    note : you better check the data that already imported. the first row of the data usually contains the header of each column on the table which you imported to csv file. delete the first row after you imported the csv file

    0 讨论(0)
  • 2021-01-16 14:38

    you need to check the "The first line of the file contains the table column names (if this is unchecked, the first line will become part of the data)" and then click on "GO".

    0 讨论(0)
  • 2021-01-16 14:40

    If you want this to import into that table you have 2 choices:

    1) Add a comma before and after the data in every row of your file, or

    2) Delete the first and third columns in your table, import the data and then add the 2 columns you deleted back.

    0 讨论(0)
提交回复
热议问题